Reputation: 29632
I have a first Android application, running in background (as service). A second application is running at the same time, which has a GUI. Now I want some information to be passed from my first application to my second application.
So how can I achieve this?
Upvotes: 1
Views: 640
Reputation: 121649
Yet another possibility is to use shared memory (i.e. Android "ashmem"):
Upvotes: 0
Reputation: 11107
It depends on the Data you are sharing either Primitive type or Persistent Data or Non-Persistent Data.
If Primitive data - use Intent.putExtras().
Non-Persistent Objects -
Singleton class
A public static field/method
A HashMap of WeakReferences to Objects
Persistent Objects :
Application Preferences
Files
ContentProviders
4.SQLite DB
Check this Developer guide for Further reference.
Upvotes: 1
Reputation: 29199
use Content Provider for the same. See http://www.devx.com/wireless/Article/41133/1954
Upvotes: 2