4

The objective is to be able to develop modules / plugins (apks) to a main application.

I've googled and found that there is the use of intents through broadcast receivers (http://www.openintents.org/), but the weakness of this approach is the memory consumption, because I would use multiple VMs.

Regarding OSGi, could not find anything very clear to android, only one application implemented using the Apache Felix OSGi but found many errors when trying to configure (http://www-irisa.univ-ubs.fr/CASA/dev/felixdroid/index.html).

I found no very current example being developed / used. I wonder if, these days, there is some strong strategy (targeted to OSGI) for those who want to provide modularization in android applications?

If anyone knows of any framework or API, please could tell me?

ricardo
  • 621
  • 1
  • 11
  • 22
  • Could you give an example of what you want to achieve with this plugin architecture in the context of mobile & Android? – Amokrane Chentir Apr 29 '13 at 13:49
  • 1
    For exemple: An application for sales oriented tablets where I could integrate modules such as calendar, chat, order of service, reporting, and more. The idea would be to keep an application customizable according to the needs of each one were to use the solution. – ricardo Apr 29 '13 at 14:19
  • 1
    Well, I really think you should consider using intents then. And if you want your application to be extended by *only* some plugins that will be designed to work with your app then you can define new intent actions and require those plugins to work with them. Also, what are you going to use multiple VMs for? – Amokrane Chentir Apr 29 '13 at 14:38
  • OSGi is based on Java VM instead of Dalvik VM. Each Android application is executed in a separate instance of the Dalvik VM, while all the OSGi applications are executed in the same Java VM. I don´t know if the performance will be slow down with much more plugins using intents. – ricardo Apr 29 '13 at 15:05
  • 2
    You are correct each app runs into its own VM. I don't even know why I asked that question. I'd recommend to not worry about this, Android is optimized to start each app on a separate VM, your concerns about performance/battery consumption should be focused more on how exactly the main app and the plugins work. My final recommendation is to still dig into Intents for what you want to accomplish. – Amokrane Chentir Apr 29 '13 at 15:30
  • Ok, I´ll try to follow your recomendations therefore, I don´t found recent documentations about use of android and OSGI. So, thanks for helps, Amokrane. – ricardo Apr 30 '13 at 13:29

1 Answers1

0

Late last year, I gave a talk on using OSGi in Android.

In short:

  • Android places some constraints on how modular you can be (there is no runtime linking, so you either have to not use that, or design your APIs very carefully),
  • prefer services over bundles.
Angelo van der Sijpt
  • 3,611
  • 18
  • 24