Android Application’s Coexistence with Another platform White paper

Android Application’s Coexistence with Another platform
White paper

This paper describes the different approaches to run an Android Application on Another platform OS. We discuss android stack and different components and runtime requirements to run an android application. This paper also gives idea about solution and ideas under development. A sample execution process explains about probable way about how an android application can execute on another platform.

Parveen Jain Contact


Android Application’s Coexistence with Another platform White paper Contents 1. 2. 3. 4. Introduction Android Architecture Co-existence Approach Conclusion Reference Figures Figure 1 : Android Stack Architecture 3 Figure 2 : Android Runtime Environment 4 Figure 3 : Android Application building blocks 4 Figure 4 : Possible Customization in Android Runtime Environment 5 Figure 5 : Android Application Framework Abstraction 6 Figure 6 : Android Libraries Abstraction Approach 7 1 . 5.

there is a steep rise in the application development for mobile devices based on different Mobile Platforms like Apple’s iPhone. middleware and some key Java applications that are essential and common while running on a Java-based. phone model and platform. called as main thread.e. This problem could be solved if it is possible to run a mobile application written for one platform to any other platform. leveraging it would offer to OEMs an economical way to populate their application stores and provide Application interoperability across different Platform. Application Framework. picking the phone inherently means users don’t have a choice in the OS it uses as they come pre-loaded. 2 . This document covers brief about Android Architecture. This gives lots of choices to users while purchasing a new Smartphone i. It pops off the messages from message queue and invokes the corresponding methods to handle it. and Applications. Cameras. Introduction During the past few years. Android Applications are different than standard mobile applications in two major ways. Palm’s WebOS. but it use basic Linux kernel for basic OS operation and enhance this kernel for its own use. 2. object-oriented application framework on top of Java core libraries running on a Dalvik virtual machine. Android application life cycle is managed by the Android Framework.  Android is an open source platform so the costs of designing the android application are drastically reduced. Tablet PC. This document explores different possibilities to run an application developed for Android on any another platform (could be Linux flavor like MeeGo or Windows or other). 2.Android Application’s Coexistence with Another platform White paper 1. 2.  Android as an embedded operating system is not limited for mobile devices. Unfortunately. Android Runtime.1 Architecture Five major components constitute the Android system from the lowest level (closest to hardware) to highest level (closest to the user). 1. The main thread has a Looper instance to handle the messages from the message queue. Setup box and other embedded devices. BlackBerry. Libraries. There exists 1 thread per process. has its own Dalvik VM instance and is assigned a unique user ID.Linux kernel.  It is not a Linux OS. and Google’s Android OS. Figure 1 shows the Android system stack. Android Architecture Why Android based Application? There are some of the following reasons  Android as a platform has a rich ecosystem of downloadable applications. Microsoft’s Windows Mobile/Phone. Android OS is more of an open-source software stack for embedded devices that include an operating system. They are . it is actually more than that like it used in Automobile. By Default installed Android application (packaged as an Apk) runs in its own Linux process. Some possible Coexistence Approaches and refer some other under development solutions.

1 Applications Applications run on top of application framework.1. calendar and others) written in Java programming language. Android applications are a set of Developer made applications and core applications (shipped with Android including an email client.3 Libraries A set of core C/C++ libraries used by various components of the Android system and Framework. These libraries are not directly exposed to developer.1.2 Application Framework Application framework is the management layer in Android. It provides a set of basic tools and APIs with which a developer can build much more complex tools and Applications. SMS program. 2. 2.html] 2. 3 .Android Application’s Coexistence with Another platform White paper Figure 1 : Android Stack Architecture [Source: http://developer. 2. The application framework consists of a set of managers like       Activity manage Window manager Content providers: View system Resource manager Notification manager etc.1.4 Android Runtime Core Java libraries: These libraries provide most of the functionalities available in the core libraries of the Java programming Libraries can be considered as a set of instructions that tell the device how to handle different kinds of data.1.

threading support and low-level memory management.1. with its own instance of the Dalvik virtual machine.6 which acts as an abstraction layer between the hardware and the rest of the software stack. Can wakeup or initiate Application. Every Android application runs in its own process. Service Content Provider UI Less task ran in background. 2.Android Application’s Coexistence with Another platform White paper Dalvik virtual machine: Dalvik VM is software applications that behaves as if it is an independent device with its own operating system and provide a virtualization layer that interprets the applications written in Java.     An interpreter-only register-based virtual machine Designed to allow multiple instances to run at once Relying on underlying OS for process isolation. Enable application to share Data Content Provider Services Figure 3 : Android Application building blocks Activity 1 APK Process Activity 2 Activity n 4 . Execute Dalvik Executable (. It offers all the basic system services like security. It is Similar to JVM but is an optimized version of the same.  Launcher: This application will launch Android application and associate it with Virtual Machine.2 Android Application Building block and Run time Application Runtime To run Android application following are components are required:  Virtual Machine: It provides the “Sand Box” runtime environment to an Application. memory management. It has following properties.  Android Framework managers & Services: It is requiring running and managing android application lifecycle.dex) format which are converted at compile time from standard class and jar files and will zipped into Android package (APK) 2. res etc.  Application: Android Application is packaged as APK contains dex. process management. Core libraries and Linux kernel patches Launcher Android Execution Runtime Environment Dalvik VM Android Framework JNI Android Core Libs Linux OS Figure 2 : Android Runtime Environment Application building block Activity Intent Receiver UI Component typically corresponding to one screen Set and respond to notifications or status change. network stack and driver model.5 Linux Kernel Linux Kernel Android is built on top of Linux operating system version 2. These manager and services are distributed among Android Application Framework.

Launcher: a launcher application needs to be developed to parse and launch the Android application APK/JAR and associate it with VM(JVM or DVM or etc) 5 . So there shall be a need to make DVM independent of android stack. managers and services) with target Platform one or some Platform independent ones. While Android Dalvik VM is well optimized for embedded device but it is tightly coupled with android stack. Android Execution Application Process Runtime Environment Base OS Core Libs VM Application J N Customized Manager and services Launcher Application Framework Linux iOS Window etc I Figure 4 : Possible Customization in Android Runtime Environment Following section explains the about some possible customizations in the Android runtime Environment components 1. 3 rd party platform like PhoneGAP etc.] 2. .Android Application’s Coexistence with Another platform White paper 3. called Dalvik.Or Devoid Android runtime environment from Android Stack. It brings greater security because apps in a VM are essentially walled off from other applications and from the device's Operating System. This can be achieved by replacing maximum runtime components (Servers. When the app in a VM crashes. Co-existence Approach Since Android Application runs in its Android runtime environment which is tightly coupled with Android stack then how could non-Android device run application made specifically for Google's Android platform? So to run Android app on other platform we have following choices . it has no effect on other applications or on the Operating System.Either Re-write the app according to target platform or some common app platform like HTML5. So if we can recreate that emulation environment on another OS. The solution is much like the Java Virtual Machine on a desktop. the apps should run as normal and without any kind of performance hit to the app’s operation. Also replace maximum runtime components (Servers. [Typically JVM is used for desktop not for embedded device because it is not optimized to support embedded system. But this is not coexistence. managers and services) with target Platform one or some Platform independent ones. ensuring stability. Virtual Machine: Since android application runs in “Sand Box” environment and this environment can be provided by some Virtual machine it could be Standard JVM or Dalvik VM or some other customized form of Dalvik VM (decoupled Dalvik from Android Stack). Android is not a application framework but it is a full-blown operating system and all apps that run on Android phones or tablets run in a virtual machine (VM).

These core services are written in C/C++ languages and directly interact with underlying core OS. In this approach android application running on another OS seems as native to target OS. either directly running the Android Application APK file or converting Android application package file into some other form that will be easily understand by the target VM environment like convert into a JAR file and then running JAR on JVM. Android Framework Mangers/Services: It is requiring run and manage android application lifecycle. Android Framework Abstraction In this replace android application framework with native application framework. JNI abstraction: This layer is required to call or interaction of JAVA code with modules written in core C/C++ languages. 3. Here are two possibilities  Either Port complete Framework on the target OS  Or make a wrapper of Android application framework which internally uses native OS application framework so that Android application can be run without any code modification. Application: To run android application in VM. This will achieve by abstracting Android Framework so that this abstraction diverts calls to native application framework calls. b.  Android Native libraries and services : The core services used by the android framework to provide necessary feature to execute an application. SQLite. Some candidate service are like BIONIC. Abstraction would be done at Android Application framework level. Android Application (JAR) Runtime Environment JVM Android Framework Abstraction JNI Native core application Framework [QT/GTK/Open Source/WinAPI etc] Native libraries and services Core OS (Linux/Win/IOS etc) Figure 5 : Android Application Framework Abstraction 6 . Either we can port the same Driver to Target OS or write a new with same interface which will use native IPC mechanism. Media Framework. a. Here we have choice to replace maximum services by the services which are independent of Android Stack. HAL – Hardware Abstraction layer. As explain in fig Android application run in VM environment and calls android APK while android APIs internally diverted to native framework. Webkit. 5. OS Kernel and Extensions: Following Kernel extensions are important because Application framework and core manager and services depend on them.1 Approaches Following are the two possible approaches based on above discussion A. 4. SGL (SKIA Graphics lib) 6. Binder: Binder driver facilitates inter-process communication and data sharing between applications and services through the use of shared memory. Power Management: Android has its own power management but application should use the native platform power policies.Android Application’s Coexistence with Another platform White paper 3. Android application developed using this framework API so Framework cannot be 100% replaced.

This would be achieved by writing JNI abstraction so that Framework services use native core libraries as much as possible. After initialization this app displays a screen which display all installed android applications. 8.   If it is First time (or Android RTE is corrupted) then execute 4. This framework will use both android and native core libraries to reduce the footprint as much as possible. When user click on ATRE on MeeGo Home screen.Android Application’s Coexistence with Another platform White paper B. “Home” Key invoke MeeGo Home screen. As explain in fig Android application run in VM environment with full android framework runtime. 2. If not then last screen – Main screen or any Android Activity last stage 7 . Android application will execute in same JVM instance as some sub activity of ARTE. Provide functionality to install android app on MeeGo. Abstraction would be done at Android Core libraries. Now user can execute any application. 5. When First Time execute. this will execute as background process in idle stage. MeeGo. 3. ARTE will not close.2 Sample Execution Process Android RTE [ARTE]: Java application native to Target OS (for example MeeGo) execute in its VM – JVM. Singleton Application and provides Android RTE to Android Application. 7. On close of ARTE. Maintenance could be high in this approach Android Application (JAR/Dex) Runtime Environment JVM/DVM/customized DVM Android Application Framework and services JNI Android libraries Native core libraries [QT / GTK / Open Source / and services WinAPI etc] Core OS (Linux) Figure 6 : Android Libraries Abstraction Approach 3. Android Libraries Abstraction In this approach android framework and supported framework services remain as such and replace android core libraries with native one as much as possible. 4. it will initialize all required services and manager in a similar way and structure to Android. Android Application is a bundle of some related Activities with One activity configured as First/Start Activity. This can be done at MeeGo Boot Time or mix need to think. Here user has no choice to move to main ATRE screen from android app with some “Home” H/W key. Because all short keys or H/W key as specific to Native OS i. 10. On close Android app. 9.e. 11. control display last screen of MeeGo. 6. control move to ARTE main screen – display all installed Android Apps. 1.

It may possible. This new app player will allow users to download Android apps from BlackBerry App World and run them on their BlackBerry Playbook.3 apps. Virtualization Approaches Virtualization is a technology that enables multiple operating systems or virtual machines to run simultaneously on a mobile phone by dividing the resources of a computer into multiple execution environments. This make more than one android apps will execute but I guess it make significant performance hit Quite possible. The actual machine on which the virtualization takes place is referred as Host Machine and guest machine is refers to the virtual machine.3 Limitations Android Architectural limitations:  Android tight coupling with Linux kernel patches like Binder. UXD experience may little different on another Platform as compare to Android Platform.  Dalvik Virtual machine and Android stack are tightly coupled with each other. Following the changes and steps required to make android app to compatible on blackberry. Applications should follow target OS power mgmt policies. It may require repackaging the existing android APK to some other form depending on the target VM environment like JAR. Emulation: Emulation is another kind of virtualization technology in which complete hardware architecture is virtualized and will be created as a software component. Workaround could be running android app in Dalvik VM which will in turn execute within JVM.4SOME OTHER APPROACHES A. Virtualization technology has been used widely for many years in other fields such as data servers (storage virtualization) and personal computers (desktop virtualization). Repackaging  Code signing  Submit it to the BlackBerry App World  Approved  Distributed through BlackBerry App World. some changes are required to make it run on Blackberry. This will be placed in a secure "sandbox" on the BlackBerry Playbook where the Android apps can be run. RIM-Blackberry Playbook RIM also support Android Applications on its upcoming QNX-based Playbook tablet with certain limitations. only one android app will execute at a time. Permission to Google market support. This software will replace the functionality of a designated hardware processor and associated hardware systems. B. Power Mgmt etc.  App Player: RIM will launch an optional "app player" that provide an application run-time environment for Android v2.Android Application’s Coexistence with Another platform White paper 3. As Android RTE will use native libraries and services. It uses a hypervisor to create secure separation between the underlying hardware and the software that runs on top of it. In this the guest OS may not have to be modified to run on an incompatible architecture.  Native code written in C/C++ dependent on Bionic is tightly coupled with it Final APIs/features support will depend on the integration of Android framework and core service with native OS. For example Android Device emulator comes as a part of the Android SDK.  8 . 3. Android Apps: Android apps will not ran directly. android application (APK) may not run directly on the target platform. some of the Android APIs may not be supported and it may have impact on some specific features like UXD experience.

Re-Write: Applications which are device-dependent or do need to be modified then re-write the application natively for MeeGo with Alien SDK. Alien Dalvik Myriad Alien Dalvik brings Android applications to non-Android devices. This paper also briefly explore possible approach used by some different under development project going on.html> Alien Dalvik Solution <http://www. Reference Android developer guide <http://developer. This repackaged Application will install on MeeGo device from OEM/Operator/3rd Party Apps> [7] IcedRobot <> Goggle Projects: <http://code. Alien Dalvik runtime: This will provide runtime environment for an Android repackaged application to execute on MeeGo.aspx> Mariad Alien Dalvik Demo <> Ubuntu wiki <https://wiki. allowing > [1] [2] [3] [4] [5] [6] 9 . For this we have to develop or customize interpreter like JVM/DVM and use native OS services as much as possible. Conclusion As we discussed in the paper.icedrobot.Android Application’s Coexistence with Another platform White paper C. maintenance effort and frequency due to rapid change technology. <http://code. 4. operators and application stores to leverage the Android eco-system across a much wider range of mobile devices. Runtime alien Dalvik can be pre-installed or automatically downloaded with the first Android application. Following are the possible major components of the solution:    Repackage: Android application need to be repackaged with Alien sdk. One more possibilities we use some standard open source services and bundle them in a single package so that it work on most of the platform OS available.myriadgroup. This has been made possible through a very tight integration of the Android runtime and the use of Myriad Dalvik Turbo technically it is possible to develop runtime environment to run an Android application on a device running on another> Google Project <>. It is clear that with any approach there are some limitation associated with it like development time. Also there is need to modify Android application package according to our approach like convert it into JAR or any custom format so that developed runtime can understand it.

Sign up to vote on this title
UsefulNot useful