How to use user defined permission in two apps?

Let’s say…

We have 2 apps, App001 and App002 and App001 wants to use the service in App002.

in App001’s AndroidManifest.xml

<uses-permission android:name="com.testpackage.mypermission"/>

in App002’s AndroidManifest.xml

;

or

&amp;amp;amp;amp;lt;service android:name=&amp;amp;amp;amp;quot;string&amp;amp;amp;amp;quot;
         android:permission=&amp;amp;amp;amp;quot;string&amp;amp;amp;amp;quot; &amp;amp;amp;amp;gt;
    . . .
&amp;amp;amp;amp;lt;/service&amp;amp;amp;amp;gt;

android:permission
The name of a permission that that an entity must have in order to launch the service or bind to it. If a caller of startService(), bindService(), or stopService(), has not been granted this permission, the method will not work and the Intent object will not be delivered to the service.
If this attribute is not set, the permission set by the element’s permission attribute applies to the service. If neither attribute is set, the service is not protected by a permission.

+reference
http://stackoverflow.com/questions/8816623/how-to-use-custom-permissions-in-android

+sk.27.03

Advertisements

Published by