0

i read so much thinks about OSGI and Android but my question is still unanswered. I working at the moment on a small application for Desktop using basicly equinox as OSGI implementation. For the common functionality i create an own OSGI-Bundle and using service registry to get the implementation and the rest is normal pojo.

I would like to ask its possible to run normal OSGI-Bundles on android with apache-felix with?

Im asking because i trying to start apache felix on android but i still getting an exception: java.lang.NoClassDefFoundError: org/apache/felix/main/Main

Big thanks

moohkooh
  • 917
  • 1
  • 10
  • 25

3 Answers3

1

Have a look at EZDroid

(Also note ProSyst have a android OSGi framework, but I'm not sure if it's Felix as you asked)

Some links:

earcam
  • 6,662
  • 4
  • 37
  • 57
  • Im copy my felix files to /sdcard/... should this a problem to run felix ?? In the example they copy the file to /data.... – moohkooh Jun 12 '12 at 05:52
1

Did you use a proper version of Apache-Felix? It is required on Android, to have all jars preliminary converted to dex format. This is the only format Android's Dalvik VM understands, otherwise you end up with this java.lang.NoClassDefFoundError.

tnachev
  • 61
  • 3
  • On my desktop implemenation i doesnt use Felix, only some jar from eclipse (as i understand equinox). Bundles that i would like to export to Android have only the org.eclipse.osgi.jar as dependency, nothing else. My idea is/war to create a desktop and android application and the core functionality are seperated from the application logic, that im able to export those bundles to android. Yesterday i get running felix on android, but on startup i getting few exception, i will post today the exception here. Of course, i creating a dex file from my bundle(s) and adding this to the jar. – moohkooh May 25 '12 at 05:46
1

Regarding the location of the Felix on Android, there is a significant difference between putting it in /data folder and in /sdcard. Not really familiar with latest ports of Felix for Android, but they might need some permissions which are location based. I would suggest to post here part of the Logcat with the exceptions you observe in order to try and offer you a solution for them. And as you said, since your bundles are not dependent on Felix specific APIs, I would recommend you to check the ProSyst OSGi Runtime for Android. It is available for free on the Android Market:OSGi Mobile. You can put your bundles on the sdcard and then install them via the UI. Hope that helps!

tnachev
  • 61
  • 3