My App has 4 parts: Main App, Widgets, Live Wallpaper & DreamService
As most of my Users don't need LP and DS, i would like to cut it off from the main app and publish as add-on via android market.
The main app uses statemanager and sqlite to save some settings. What would be the best way, that the LP and DS (which need a differant packagename, i guess..) can access the data from the main app?
Usually this would be done with Content Providers. However, you would need a Java lib for that, since usually content providers are specific.
Secondly, you can use Intents.
Thirdly, store the data on a known location on the sdcard where all the apps can access it.
I have used Intents and PackageManager to create a plugin mechanism for Cloudpipes.
If you store the settings file in File.DirDefaultExternal of one app then you will also be able to access it from other apps. You just need to build the string correctly.
It is a bit complicated the way I did it, but here is what is involved:
Intent filters. In the manifest file you need to add intent filters for the intents you want to receive. You can create your own intent names.
Permissions. You can create permissions on those intent filters, to restrict only your apps to access them, although this is not necessary.
Intents. Here you actually build your intents. However, to get the data back, its better to implement onResult, so once the intent is delivered the other app can return data back to you via a ReturnIntent.
The code again is very specific for cases. I'll see if I can find an example I did a while ago.