0

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!

Divya Jain
  • 393
  • 1
  • 6
  • 22
Karthik
  • 31
  • 8

3 Answers3

0

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

Nambi
  • 11,944
  • 3
  • 37
  • 49
0

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.

Waqar Ahmed
  • 5,005
  • 2
  • 23
  • 45
0

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());
    }
manuell
  • 7,528
  • 5
  • 31
  • 58
Barışcan Kayaoğlu
  • 1,294
  • 3
  • 14
  • 35