Defining your own permissions in android -


i trying make own permission android application.

for android manifest file looks this.

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.example.hp.happybirthday" >      <permission         android:name="com.example.hp.happybirthday.perm"         android:description="@string/pdesc"         android:label="@string/careful"               />      <application         android:allowbackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:theme="@style/apptheme"         android:permission="com.example.hp.happybirthday.perm">          <activity             android:name=".mainactivity"             android:label="@string/app_name" >             <intent-filter>                 <action android:name="android.intent.action.main" />                 <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>     </application>  </manifest> 

the problem facing want have own permission associated application , hence have added following line shown above under application tag, activities have access app possess defined permission.

android:permission="com.example.hp.happybirthday.perm" 

but problem when try run app, app manifest file have declared, shows error app not installed.

but when remove above mentioned line, works, activity have access app not want.

when try run app, app manifest file have declared, shows error app not installed

that because home screen app, , home screen not hold custom permission. hence, home screen cannot start launcher activity.

then activity have access app not want

first, custom permissions do not work well.

second, permissions applied @ finer granularity "this app". secure components need security, , leave public other components, launcher activity.


Comments