You might want to read the rules of the game when several users are added to the device in this document under the “Effects” section. It should be obvious that what you are trying to accomplish will be a “creative workaround” or simply impossible.
So, what Android tools exist for data exchange applications that are not a file system? Well, the usual mechanism is ContentProvider , but I suspect that two isolated instances of the application cannot access ContentProviders to each other (and, moreover, how would you tell them apart?).
Suppose that user instance applications simply cannot access each other. Maybe they can share some system-level tools that are available to all applications all the time, regardless of who the active user is? The only thing that happens to me when I write this is DropBoxManager . Unfortunately, it is not reliable, since there are restrictions on how much it can store, and these restrictions can cause your data to be pushed out of the queue at any time before it can be read by another instance of the application. In addition, the data there is essentially publicly available, which may not be what you want.
If you want to go crazy, you can go back to ContentProviders and somehow use system-level providers for calendar or contacts for data storage, if both applications know how to find a secret special record. Wild stuff.
Another solution may be to store all your data on a server, and each user enters a key to be able to place and read / write their data block on the server. If not a manual key, try using some “unique” property of the device as a key. This is probably the best solution, since you have more guarantee that something will not accidentally delete or expose your data.
Doug stevenson
source share