Thursday, September 19, 2013

Deploying Magic xpa Applications on Android

I've enjoyed the recent series of videos on mobile development for Magic xpa Application Platform. As readers of this blog know, Magic Software's Magic xpa Application Platform allows you to build and deploy applications including mobile apps. Deploying those apps on Android emulators and Android smartphones is straightforward enough. Deployment on the emulator is presented in a recent video in the Developing for Mobile Series: "Running a Magic xpa Application on the Android Emulator." 




When it comes time to deploy your ANdroid apps, you can choose from four basic deployment methods:

The Run Method. One way to deploy an application is to run the APK file on your Android. This is usually done when you receive the file as an email attachment. All you have to do is click on the attachment. 

Over the Air Method. As you might guess from the name, the Over the Air method of deployment for Android allows you to use your Internet browser to browse to a URL on an Internet server where the .apk file is located and then click to download. For this to work, you need to put the APK file on an exposed folder on the web server. If the application does not run, configure the web server to support download of the APK file as follows: Open the Internet Information Services (IIS) manager, navigate to the Default Web Sites, open the Mime Types and add a new one as follows:
  • Extension=.apk
  • MIME type=application/vnd.android.package-archive

    Using the Android Market. 
    You can also upload your application to the Android market.To do this, you use the ADB command line utility – when installing on a simulator or on a device using a cable. You can install the APK by using the Android Debug Bridge (ADB) utility, which is located in the platform-tools folder in your SDK folder, usually at: C:\Program Files\Android\android-sdk\platform-tools.Finally, to install your APK, run the following command: adb install –r my.apk.
Enjoy the video!

Wednesday, September 4, 2013

Off the Hook: Introducing Offline Programs

With the release of Magic xpa 2.4, Magic xpa RIA applications have offline capabilities in addition to online capabilities for browser-free Internet and mobile apps. Magic xpa applications are comprised of multiple programs that perform specific tasks. Magic xpa Application Platform now supports the creation of RIA applications that may be comprised of both online programs that are connected to the server and offline programs that use local resources and storage. Magic xpa Offline Programs are Rich Internet/Client applications (RIA) that work while not connected to a server and store information locally on the client device. An offline program runs only on the client and will not access the server and cannot use server resources.
Because you can now build applications with both connected and offline capabilities for Windows, iOS and Android devices it is important to think through the necessary application patterns to deal with the lack of a connection to the server. Offline programs allow users to continue to be productive in areas with intermittent, limited or unavailable internet connectivity. While working offline, data is stored locally on a local database, and periodically, when internet connectivity resumes, you can synchronize it back to the server.
Offline programming requires you to overcome the limitations imposed by the challenges and constraints of working without a server connection. In contrast to online programs, the server connectivity is either non-existent or unreliable. Your apps need to be adjusted to handle this state carefully, while creating a usable app and maintaining data integrity. The challenge in offline programming is to keep the data consistent and synchronized while providing the user a meaningful experience while disconnected. Magic xpa allows you to create apps that store a subset of relevant server data or client-only data locally on the client. Magic xpa allows you to store user credentials on the client for apps that require user authentication. In a Magic offline program, data can be entered on the client and later updated for consistency with the server. This means Magic xpa now provides bi-directional data sync between the client and the server. Magic xpa ensures a seamless user experience when connections are slow or lost allowing uninterrupted operation and data consistency. A Magic xpa offline program also accesses application resources locally on the client such as application metadata and images. New tools and features in Magic xpa allow developers to overcome offline programming challenges and provide users with a rich-interactive experience regardless of connection issues.
Since Magic xpa applications can work without network connectivity or with intermittent network connectivity, new application patterns must be considered.
Startup. When you start a Magic xpa offline program for the first time, you will need to be connected. Magic xpa uses this first invocation to sync the resources that you the programmer have specified such as client-side data, metadata, and images.
User Authentication. When you want an app with user authentication, the user credentials will need to be stored securely on the client in order for authentication to occur while offline. When reconnecting, credentials should be checked again.
Local Resources. After initial startup, offline programs always use local data and images as resources. In this fashion, they always work even when there is no connection to the server. Data updates are always stored to the local device and only when connected is the matter of data consistency with the server handled.
Master-Master Synchronization. Magic xpa allows you to use a master-master pattern http://msdn.microsoft.com/en-us/library/ff650702.aspx for bi-directional data synchronization so you will need to think through your business rules for resolving data conflicts. At intervals you specify, the application will attempt to synchronize client-modified data back to the server and server-modified data back to the client. The assumption is that there are multiple clients that may be modifying data as well.
Metadata Synchronization. Magic xpa will automatically synchronize application metadata on startup or when the application changes.
Whether you need Windows, iOS (iPhone, iPAD) or Android apps in offline mode, Magic xpa Application Platform provides an ideal solution for developers of enterprise mobile apps that are fully integrated and completely native. 

In a future post, will look further into how-to create offline programs in Magic xpa 2.4 and above.