How to restrict content provider data across applications

前端 未结 2 1893
长情又很酷
长情又很酷 2020-11-29 08:38

How can we ensure that certain applications are not able to access my data stored in content provider where in certain other applications can access that? Basically I need t

2条回答
  •  -上瘾入骨i
    2020-11-29 09:19

    In the AndroidManifest.xml, at the screen with the properties of your ContentProvider, you have two fields:

    Read Permission WritePermission

    So, you can define secure strings (also it may be path to some file) that are permissions for acces to your ContentProvider.

    Applications that want to access your content provider must have that ones added in their UsesPermission elements.

提交回复
热议问题