Friday, September 5, 2008

Rich Internet MobileNet Applications

Introduction

Using AJAX-style user interface for OSGi-based applications is not a new idea. We even saw this concept on mobile devices, for example in an OSGi demo at Java One in 2007. The Rich MobileNet Application (RMA) concept takes these ideas several steps further and generalizes them to other UI technologies as well. The concept was first introduced in the OSGi Community Event 2008 in a presentation by Jon Bostrom. RMAs are an important new feature of Sprint Titan Platform. But what exactly RMAs are?

Motives

Rich Internet applications (RIAs) are web applications that have the features and functionality of traditional desktop applications. RIAs typically transfer the processing necessary for the user interface to the web client but keep the bulk of the data (i.e., maintaining the state of the program, the data, etc.) back on the application server.

Rich MobileNet Applications are the mobile extensions of Rich Internet Applications. Though many ideas used in RIAs are applicable and beneficial in mobile environments, there are mobile specific aspects that need to be taken into consideration when creating an application for mobile:

  • Connection Model: as opposed to RIAs, mobile applications should function in an occasionally connected environment. Access to the Internet may be available, may be limited or may not be present at all. For better user experience and improved usability, applications have to be prepared both in on-line and off-line mode, they may need to be able to synchronize data stored on the device with a backend when getting online, and be ready to use the local data store when the connection is not available.
  • Integration to Phone functions: applications designed for mobile devices should take advantage of mobility. Therefore, they need to be able to access the specific functions of the underlying device, such as call control, position, messaging or PIM.
  • Task flow, task focus: mobile applications have to prepare for mobile-specific events (for example incoming calls)
  • One hand operation: mobile applications should prepare for the limited input capabilities of the device and should be easily usable with one hand.
  • Touch: RMAs should be able to utilize the touch capabilities of the device, however they should also be prepared to operate without touch support as many devices do not have touch UI at the moment.
  • UI design: Device displays are lot smaller than PC screens. Additionally, the screen size and resolution may vary in a wide spectrum between devices. Some devices have multiple displays and the user may switch between them while using the application. Mobile applications should be prepared to such variances and be able to adapt to the device UI capabilities flexibly.
  • Code loading: RIAs are typically loaded over the Internet at start up. Though this approach has advantages in lower maintenance costs – no need to reinstall application at update – it makes the application dependent on Internet access. Mobile applications have to operate in an occasionally connected environment; therefore, it must be possible to install applications to a device locally.
  • Security: Accessing mobile-specific functionality is an important opportunity for mobile application, but they represent a big risk for the security and privacy of the device user. Additionally, mobile devices are subject to different kinds of attacks than PCs. For example, they operate in a changing network environment – due to mobility and roaming – and they are much easier to steal or lose. Therefore, the security measures applied in mobile applications and the underlying platform need to address these new threats as well.

If an application doesn’t handle these aspects properly, the result may be limited or no usability and poor user experience. Rich MobileNet Applications (RMAs) are the mobile extensions of Rich Internet Applications. Though building on technologies used in RIAs and benefiting from their advantages – like platform independence – they utilize mobile-specific solutions that enable the optimization of user experience for mobile devices.

So, what is an RMA?

An RMA consists of a renderable UI – HTML/CSS, JavaScript, Flash Lite etc – that is executing in the corresponding container and which can access the services running in OSGi Service Platform. These services can be generic-purpose services, shared by multiple applications or they can be application-specific, which allow implementing the computation-intensive business logic of the application in Java, utilizing the full power of CDC JVM and the OSGi Framework on top.

RMA Architecture in Titan Platform

Using CDC Java enables access to device functions (messaging, positioning, call control, PIM etc.) and platform services like file system, networking or even a database. Using Java security, a fine-grained access control of these resources is implemented.

Mobile OSGi provides the platform to develop applications from components (shared or application specific) and it enables the management of these components both locally and for a remote administrator. Using the local management capabilities and OSGi dependency management, missing components can be loaded on demand.

Using HTML or Flash as UI technologies enables a high level of portability with rich user experience. However, probably an even more important aspect is that these technologies are currently used for Internet applications. They have established patterns and solutions for most typical tasks, there are frameworks supporting web application development. RMA enables to take these into use in mobile applications.

The communication between the UI runtime and the OSGi Service Platform uses some HTTP-based remote access protocol like SOAP or JSON RPC. OSGi is an ideal platform for this with its servlet container implementation known as the HTTP Service. The Service Platform provides a mechanism that automatically exposes the available services through the supported protocols. It also provides a service registry where RMAs can find and bind the available services. These automatic mechanisms make the creation of services simple and straightforward, the service developers’ exposure to the complexities of remote access is minimal.

OSGi HTTP Service is used to enable the local installation of web applications to the device. Local installation capability is very important for the occasionally connected devices to ensure the availability of the application.

More Complex Scenarios

The architecture above describes the simplest form of Rich MobileNet Applications, where the application UI and the services are both installed to the device locally and all communication takes place within the device between these entities. However, RMAs are not limited to this simple architecture only:
  • Services can be external to the device. They can be publicly available web services on the Internet but they can also be services running on another mobile device. RMAs can simply mesh up local and remote services to create some unique user experience.
  • Applications don’t necessarily have to be installed to the device locally. An AJAX-style web application can be just loaded from a public web site on the Internet (or another mobile device) and it can still access services locally on the device (under appropriate access control).
  • The management capabilities of Mobile OSGi enable advanced RMAs to check the availability of required services and initiate their deployment if they are missing.

Conclusion

RMAs are an exciting adaptation of the RIA concept to mobile devices. It enables RIA developers to leverage their knowledge in the mobile space but without compromising the user experience on these limited devices. RMA support will be an integral part of Sprint Titan Platform; it will be in devices early next year. So watch out and prepare, RMAs are around the corner!