I´m currently trying to share information between different applications in Android, the goal I´d like to achieve is having the same behavior the KeyChain data share have in iOS but in Android.
I´ve already given a try using SharedPreferences and using "shareUserId" attribute inside Manifest, (by default Android applications behave as sandBoxes and they are not allowed to share data, they also haven´t a common context, so a "fake" one must be built) issues here come by the fact that is mandatory to know every app´s packageName so the data share happens between those apps with the same shareUserID value. I mean, I would like to access this resources without having to ask for the application that stored them.
Context appOne = createPackageContext("com.xxx.zzz.appOne", CONTEXT_INCLUDE_CODE);
mSharedPref = appOne.getSharedPreferences("Test", Context.MODE_PRIVATE);
Other way I tried was using the AccountManager in order to store that information so other applications could reach it. Bad news were that this account will be shared among all applications installed in the system and i will like this behavior to be more restrictive in terms that I would like to be able to choose which apps will have access to this information and those who won´t.
Reference to related post (Should you use AccountManager for storing Usernames and Passwords for an Android app?)
Is there anyway to achieve this goal? Any help or hint will be appreciated, been stuck in here for a couple of days... If extra information is needed feel free to ask for it. Thanks in advance.