I'm developing one app, I need to execute some functionality in one app from the result of another app, how to I pass a data from one to another ,Please give me any example programs for this.
Thank you!
I'm developing one app, I need to execute some functionality in one app from the result of another app, how to I pass a data from one to another ,Please give me any example programs for this.
Thank you!
Use the Json
or XMl
. Read the Json
from the url that the another app that wants to read and
post data in form of the json or xml to the url
For Api level 14 or getter ShareActionProvider
you can use content provider for this but i dont use this personally. what i do. I make a folder in sd card and the data that i want to share, is place in that folder and then access that data from other application becuse i know all the things that i used in creating that folder or whatever thing like database etc.
The best Option is to Use to shared Preferences ,which will help passing data between apllications and the main note if you uninstall parent application shared preferences will get deleted,,,,
private SharedPreferences mSharedPrefs;
mSharedPrefs = getSharedPreferences("PrefName",
Context.MODE_WORLD_READABLE);
mPrefsEditor = mSharedPrefs.edit();
mPrefsEditor.putString("tagName", "value");
mPrefsEditor.commit();
and in your next application or activity
final ArrayList<HashMap<String,String>> LIST = new ArrayList<HashMap<String,String>>();
Context myContext = createPackageContext("com.example",
Context.MODE_WORLD_WRITEABLE); // where com.example is the owning app containing the preferences
SharedPreferences testPrefs = myContext.getSharedPreferences
("PrefName", Context.MODE_WORLD_READABLE);
Map<String, ?> items = testPrefs .getAll();
for(String s : items.keySet()){
//do somthing like String value= items.get(s).toString());
}