Multiple applications sharing the same data directory

my ultimate goal is to have two applications, the β€œmain” application (which will do all the work that the user wants to do), and the β€œlicense” application, which will check if the application is licensed.

My question is: how can I get my licensed application (com.example.myapp.licence) for sharing the same data directory as with my main application (com.example.myapp) ??

+2
source share
1 answer

You need to modify the manifest files for both applications, add the same "android: sharedUserId" element for both manifest nodes.

eg.

<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:sharedUserId="com.mycompany.myapp" .... /> 

If both applications have the same sharedUserId, they can access other data folders.

I forgot to add: obviously, you need to sign both applications with the same private key with the same alias.

+6
source

All Articles