开发者

multiple apps, sharing same data directory

my end goal is to have two apps, a "main" app (which will do all the work the user wants it to do), and a "licence" app, which will check if the app is licensed.

my question is, how can i get my licence app (com.example.myapp.licence) to share the same data directory as my main开发者_高级运维 app (com.example.myapp)??


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

e.g.

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

If both apps have the same sharedUserId, they can access each other's data folders.

Forgot to add: obviously you need to sign both apps with the same private key with the same alias.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜