A few days ago, during the SAPphireNOW ASUG 2011 conference in Orlando, Florida, I released the Proudly Presenting the SAP Mentors Outreach Mobile App for Android – Connect with SAP Mentors at SAP... (download at https://market.android.com/details?id=de.thorstenster.mentors). It is a social mobile app for Android that allows you to browse and search the profiles of SAP Mentors, comment and share them, and get in touch with the Mentors via twitter. (I described its functions in detail in this blog.) Currently, there are a little more than 100 installations. A team is working on a port for iPhones and iPads; meanwhile, non-Android users can use the web-based version optimized for mobile devices.
Fig. 1: Architecture
The back-end of the SAP Mentors Outreach app is an application in SAP River. River is a Platform as a Services (PaaS) offering by SAP that is not yet generally available but in a beta stadium. To learn more about River, please read the following blogs and Wiki pages:
The Mentor program uses River internally: We have created apps to maintain master data for Mentors, build up an expertise database, and link it with conference attendance data entered through Google Forms. The primary app, called SAP Mentors Expertise System, is the back-end data source for the mobile app.
What predestines River as a data source for mobile apps?
Architectural pattern: River as an enriching proxy
I’d like to dwell on the “proxy for remote data” point for a second because this is where I see an architectural pattern and some of the biggest value of River for mobile apps.
River allows you to access the Atom services in your ABAP system but optimize those structures for remote consumption without leaving a footprint in the ABAP system. Also, you can add new tables to the application that work together with back-end data but reside entirely in River, again minimizing the impact on the ABAP back-end.
Your typical back-end system: Innovation at a snail’s pace
Minimizing the impact of new functions on the ABAP back-end is crucial because in most real-world ABAP systems, even though you as a gifted developer may be able to create a few new functions in a day, the entire system follows a long-paced rhythm that will cause your development to stay out of production for weeks or months to come. At many sites, production systems are updated with what amounts to a new release two to four times per year. Among the reasons for this slow update frequency are:
Breaking out of the slow, established rhythm with Edge Innovation
Implementing new, isolated functions outside this treadmill allows you break out of the slow established rhythm and frequently out of bloated, overly bureaucratic processes. If your new function is implemented not as a change to your ABAP system but as a new client, you may get away with going live immediately without having to wait for a new production release.
This is places River in the realm of “Edge Innovation” (also: “Fringe Innovation”), where rapid innovation is possible because it takes place far away from the stable, slowly moving application cores of your traditional back-end systems.
When the app loads Mentor data, it uses River’s automatically provided REST interface to retrieve the data (in a very strange XML format and without images) via HTTP. It parses the XML, creates Mentor objects in a collection, and displays the list (still without images).
To load the thumbnail images, the app takes the RiverId (the database key for a Mentor in the River database) and calculates the URL of the thumbnail stored in River from it, and retrieves it.
A few words about the data management and threading:
1. The "naked" (without data) app starts an asynchronous (parallel) thread that retrieves the XML file and builds the collection of Mentors from it.
2. When this is complete, a second asynchronous (parallel) thread is started. It goes through all the mentors, retrieves a thumbnail for each and immediately makes it visible in the list. This way you can watch the thumbnails appear one by one.
3. As soon as the last thumbnail is loaded, the entire collection including images is serialized and written to a cache file on the device.
4. Each time you start the application it checks whether a cache file exists; if it does, the app builds the collection of Mentors with pictures from the cache file.
5. As a developer, once before each release, I create a build that writes the cache file to a location where I can extract it from the device and bundle it with the application that I put on the Android Market. This way the app can run immediately after installation with a current data set without having to first pull it from the net at a conference with bad wifi.
When developing for Android mobile devices, you program in Java, but even if you already know the language, you will have to learn some specifics about the behaviour of your app’s environment to make it robust enough.
Time-outs
Android makes sure that the user doesn’t have to bear with unresponsive apps. So whenever an action in your app keeps the user interface unresponsive for more than 5 seconds, Android will assume the app got stuck and kill it (or offer to do it). The way to deal with this is to perform long-running tasks asynchronously in parallel threads.
Object instance life-cycle
Android has to handle system resources economically. Therefore, it frequently kills objects that are not currently needed. More specifically, it takes the liberty to kill the objects representing app screens that are currently not visible because the user is doing something else. In order to preserve app state across such killings and resurrections, you have to learn to use the system’s hooks for state serialization and deserialization. Also, data “coming home” from asynchronous tasks not be directed to long-dead UI objects.
(I have no experiences with programming for iOS and BlackBerry but I assume there will be similar idiosyncrasies.)
River can serve as a stand-alone back-end for mobile applications, but it can also provide access to SAP data while maintaining the light-weight, minimal footprint character of an edge innovation application.
Also, it can act as very basic middleware component without requiring a big footprint in your system landscape, thereby allowing you to get started with mobile enterprise applications without immediately requiring Sybase SUP or similar tools.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
9 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |