I’m planning to deploy several applications that will share a single ‘Core Functionality Helper’ component and would like to avoid requiring users to install two “apps” (e.g. ‘Core’ + ‘Plug-in Component X’) to get started. I’d also like to avoid duplication of the ‘Helper’ component code on the user’s device when two or more components are installed.
So there would be many valid installations. For example some of the valid installations on a device might be –
- Core + Plug-in A
- Core + Plug-in B
- Core + Plug-in A + Plug-in B
- Core + Plug-in A + Plug-in B + Plug-in C
All components will have user interfaces and the Core will include at least one widget into which the other components will “plug in” from the user’s perspective.
In the market I would like to offer “Plug-in A”, “Plug-in B”, etc. separately, and not force the user to have to independently install the “Core App”. Silly as it may seem, I think it turns off users to have to install two “Apps” the first time they want to get the functionality provided by one of the plug-ins.
Since that kind of dynamic conditional packaging of apps into a single apk in the market is not possible today, my question is this –
Is there an elegant and efficient way to accomplish this kind of modular UI design without having to ask the user to install (and eventually update) two apps the first time? (And of course we don’t want a lot of duplication of code on the device.)
edit: I’ve edited the question above extensively to make it more clear. My original use of the term ‘Component’ was unfortunate as these are not necessarily Android code components (i.e. Activities, Providers, Services, etc.). I’ve used the term “Plug-in” in the edits above to be clear that this is all for user convenience at install time and to avoid duplicate code on the user’s device.
After some more research I’ve concluded that this can not be done elegantly from the user’s perspective.
The most appropriate way to achieve the objective is to package the Core app separately and when a user installs one of the plugins then use an intent to test whether the Core is present. If it is not then direct the user to the marketplace where they can install the Core app.
Marking this as closed but if a better answer emerges I’ll update.