Apache Felix Framework and Google Android
The purpose of this document is to explain how to use Apache Felix on Google's new mobile phone platform - Android.
Dalvik VM
Google Android SDK allows developers to write Java code in order to create Android applications. Instead of a regular Java Virtual Machine that executes this code, a special-purpose virtual machine named Dalvik is being used in order to comply with mobile platform requirements. Dalvik does not use Java bytecode format, but, a tool named dx, included in the Android SDK, transforms the Java class files of Java classes compiled by a regular Java compiler into another class file format (the .dex format) (the conversion is not done at runtime).
Preparing bundles
Although Felix, since version 1.0.3, has built in support for Android, there are still some things needed to be done in order to successfully make use of it ( you will need to install Android SDK and you should have <android_SDK_HOME>/tools added to system PATH variable). The zip file available for download has been created in the same manner.
...
No Format |
---|
cd osgi-android emulator & find * -type f -exec adb push {} /data/felix/{} \; |
Launching Felix
Once you've done that, you should be able to launch Felix and the bundles on Android: start emulator shell, change directory to the location of your Felix files and execute felix.sh.
...
No Format |
---|
start file:bundle/EnglishDictionary.jar start file:bundle/FrenchDictionary.jar start file:bundle/SpellChecker.jar |
Embedding Felix
Apache Felix can also be integrated with an Android application. To achieve this, you need to embed Felix into onCreate()
method of your Activity class (see Android docs for more details on how to use an Activity) and process your bundles as shown above.
Download
The project zip file osgi-android.zip