多个应用程序,共享相同的数据目录多个、应用程序、目录、数据

由网友(妳若在 我便在)分享简介:我的最终目标是让两个应用程序,一个主的应用程序(这将尽一切用户想要它做的工作),以及许可证的应用程序,这将检查应用程序的许可。my end goal is to have two apps, a "main" app (which will do all the work the user wants it to d...

我的最终目标是让两个应用程序,一个主的应用程序(这将尽一切用户想要它做的工作),以及许可证的应用程序,这将检查应用程序的许可。

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.

我的问题是,我怎么能得到我的许可应用程序(com.example.myapp.licence)共享同一数据目录作为我的主要的应用程序(com.example.myapp)??

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)??

推荐答案

您需要修改清单文件,这两个应用程序,添加相同的机器人:sharedUserId元素,既体现节点。

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

例如。

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

如果这两个应用程序具有相同的sharedUserId,他们可以互相访问的数据文件夹。

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.

阅读全文

相关推荐

最新文章