android 多个应用之间共享数据库,如何在android中的两个或多个应用程序之间安全地共享数据?...

您必须使用相同的sharedUserId声明您的应用程序,例如:

package="com.mydomains.myapp"

android:sharedUserId="com.mydomains.shared.user.id"

android:sharedUserLabel="@string/appName">

在这种情况下,存储在两个应用程序的私有存储中的所有数据将彼此可用(假设它们已使用相同的签名进行签名)

阅读手册:

sharedUserId: The name of a Linux user ID that will be shared with other applications. By default, Android assigns each application its own unique user ID. However, if this attribute is set to the same value for two or more applications, they will all share the same ID — provided that they are also signed by the same certificate. Application with the same user ID can access each other’s data and, if desired, run in the same process.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值