I believe that both applications will need to declare that they use those permissions, in their <uses-permission /> part of the manifest.
My app declares its own permissions for read/write in the ContentProvider and the permissions appear in three places: the declaration of the permissions; the <uses-permission /> and in the declaration of the ContentProvider, like so: <permission android:name="com.example.mypermission" ...... /> ... <uses-permission android:name="com.example.mypermission" /> ... <provider ....... android:readPermission="com.example.mypermission" android:writePermission="com.example.mypermission" /> I haven't tried using those permission from another application. On Sep 21, 7:44 am, Sohan badaya <sohan.bad...@gmail.com> wrote: > Hi Jerome, > > I tried your solution, but still it's not working. > I am getting same exception. > > ERROR/AndroidRuntime(18573): java.lang.RuntimeException: Unable to start > activity ComponentInfo{com.test.access/com.test.access.TestDatabaseApp}: > java.lang.SecurityException: Permission Denial: writing > com.provider.ContactsProvider uri content://com.permission.test/employee > from pid=18573, uid=10027 requires android.permission.permWrite. > > and in Content Provider application i wrote > <provider > android:name="ContactsProvider" > android:authorities="com.permission.test" > android:readPermission="android.permission.permRead" > android:writePermission="android.permission.permWrite"/> > > and in other application i write > > <uses-permission android:name="android.permission.permRead" /> > <uses-permission android:name="android.permission.permWrite" /> > > Please let me know what's wrong i am doing. > > Thanks and Regards, > Sohan Badaya > > > > On Tue, Sep 21, 2010 at 1:34 PM, Jerome Deng <deng.jer...@gmail.com> wrote: > > Try to add below lines to your app2's manifest file: > > <uses-permission android:name="android.permission.permRead" /> > > <uses-permission android:name="android.permission.permWrite" /> > > > On Sep 21, 2:57 pm, Sohan badaya <sohan.bad...@gmail.com> wrote: > > > Hi All, > > > > I have a doubt regarding content provider.My doubt is > > > I create a app1 that creates ContentProvider and in second > > > application(app2) i am using app1's contentprovider methods(like > > > insert, update etc). It's working fine > > > but i want to set some permissions in app1, so that if any other app > > > wants to use that provider it must have to get this permissions(<uses- > > > permissions) then only it should be able to use providers. > > > > But when i write > > > <provider > > > android:name="MyContactsProvider" > > > android:authorities="com.permission.test" > > > android:readPermission="android.permission.permRead" > > > android:writePermission="android.permission.permWrite"/> > > > > in app1, other applications are not being able to use provider. I want > > > to know what is the tag that i have to write in other application to > > > use provider. > > > > Please help me for the same. > > > > Thanks and Regards, > > > Sohan Badaya > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com<android-developers%2Bunsubs > > cr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en