I'm actually working on OSGi on Android, and I'm close to reach my goal, but there's one little problem.
The framework (Apache Felix) is running successfully. The problem comes from Bundles that want to get Context of the Application. I just can't try to use them, because at runtime, I've got a beautiful "Could not find classe Android.content.Context", refrenced from [...]. (And then come a NoClassDefFoundError when trying to get the ServiceReference)
I linked the Android.jar to the Bundle, but it doesn't seems to be enough (even if compilation is ok). Maybe it's the way I'm creating the bundle that's wrong, I juste export it as a .jar when finished.
So if you've got some tips about how to solve this problem, they're welcome ;)
Thanks !
Android.content.Contextpart of the Android API? It sounds like this needs to be exposed as an export of the system bundle. You could do this by addingAndroid.contentto theorg.osgi.framework.system.packages.extraproperty. - Neil BartlettconfigMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, "android.content");Then, in the Activator, I'm registering the current Context like that :this.m_context.registerService(Context.class.getName(), appContext, null);Finally, I'm trying to get the corresponding ServiceReference in this way :ServiceReference ref = context.getServiceReference(Context.class.getName());but it throws an "NoClassDefFoundError" at runtime for this line. - Quentin