On Thu, Feb 23, 2012 at 6:08 AM, ashiq sayyad <[email protected]> wrote: > I have created one custom content provider.I want only my apps should > use my custom content provider and the outside apps should not be able > to use it even if they know the URI of the content provider. > > Is it possible???
One possibility is to use permissions. However, other apps could find those permissions and request them, and if the user grants them, those other apps have access to your content provider. If your content provider is only used by one app, add android:exported="false" to its <provider> element, and no other app will be able to access it. If your content provider is used by multiple apps of yours, and they all will be signed by the same signing key, it appears that you can use Binder.getCallingUid() and checkSignatures() to confirm that the content provider APK and the requesting APK were signed by the same signing key. You can see an example of that in this pair of sample projects: https://github.com/commonsguy/cw-advandroid/tree/master/Introspection/CPProxy -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training...At Your Office: http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

