Plugin Management for an Android application

2.4k views Asked by At

We want to develop and extensible Android application, and are looking for a way to handle plugins.

What do you think would be the best approach:

  • Using Android's PackageManager. The problem here is that the PM isn't designed with plugins in mind, so we'd have to implement functionalities such as dependency checks ourselves.

  • Using an existing Java framework such as JPF (Java Plugin Framework) or OSGi. OSGi looks too massive for us, and there's isn't too much information available about JPF on Android.

  • Other ideas?

2

There are 2 answers

2
Christian Gawron On BEST ANSWER

What exactly do you mean with "plugin"? With the Intent and IntentFilter concept you can already do many things I would call "plugin". For example, you can allow other applications to add entries in your context menu.

2
Marcel Offermans On

A different approach could be using the OSGi framework. I'm not sure if you're familiar with it, but it allows you to build your application out of components (called bundles) and those can be installed, updated and uninstalled without having to stop other components. OSGi is used a lot to create either completely modular applications, or to create a plugin mechanism for existing applications.

There are several open source implementations of OSGi. Apache Felix runs out of the box on Android, and embedding it in your application is fairly easy as well.

If you're interested, I can provide more pointers, so feel free to follow up on this answer.