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.