O'Reilly logo

Android Application Security Essentials by Pragati Ogal Rai

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Component level permissions

All Android components can be secured using permissions. The following figure illustrates this concept:

Component level permissions

Let's talk about permission declaration and enforcement for each component.

Activity

Any Activity can be secured by permission, by calling out the permission in Activity declaration in the <activity> tag. For example, the Activity OrderActivity with a custom permission com.example.project.ORDER_BOOK will be declared as follows. Any component that tries to launch OrderActivity needs to have this custom permission.

<activity android:name=".OrderActivity" android:permission="com.example.project.ORDER_BOOK" android:exported="false"/> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required