SlideShare a Scribd company logo
1 of 12
Android Permission System
Agenda
● Introduction
● Application Sandbox
● Types Of Permission
● Check For Permission
● Request For Permission
● Handle Permission Request Response
● How Android System Ask For Permission
Introduction
●
To protect android system and user's privacy, Android system runs
each application in a limited access sandbox.
● If the app wants to use resources or info outside of its sandbox,
The app has to explicitly request permission.
●
Earlier all permissions used to set at installation time and can not
change untill the reinstallation, but now in new version of android,
Permissions are asked at the time of usage.
● In order to grant a permission, It should be declared in the
manifest file, The system then evaluates it and make a final
decision on whether to grant or deny.
Application Sandbox
● The Android system assigns a unique (UID) to each
android application and runs it in a separate process.
● Limiting the access of application.
● Any program can ask to Activity Manager to launch
other application, which runs with that application's UID.
● For instance A is not allowed to do something malicious,
like to read application B's data or dial the phone
without permission.
Types Of Permission
● Depending on the type of permission that app requests, The system
may grant the permission automatically, or ask the user to grant the
permission.
● Normal Permissions: Normal permissions do not directly risk the
user's privacy, so the system grant the permision automatically. Ex –
permission for flashlight.
● Dangerous Permissions: Dangerous permissions can give the
access to the user's confidential data, So user has to explicitly give
approval to your app. Ex – permission to read contact.
Check For Permission
● If your app needs a dangerous permission, You must check
every time whether you have permission to perform an
operation that require the permission.
● The user is always free to deny the permission, So even if
the app used the calander yesterday, It can't be assumed
that it still has permission today.
● To check, If the app has permission, Call the method
ContextCompact.checkSelfPermission().
● The method will return an integer, You can
compare it with
PackageManager.PERMISSION_GRANTED or
PackageManager.PERMISSION_DENIED.
● See the code snippet:
//Assume thisActivity is current Activity
int permissionCheck =
ContextCompact.checkSelfPermission(thisActivity,
Manifest.permission.WRITE_CALENDER);
Request For Permission
● If your app doesn't already have the requred permission, The
app must call requestPermission() method to request
appropriate permission.
● You just need to pass required permission and a request
code to identify the permission request as parameter.
● This function works asynchronously.
● After the user responds to the permission dialog box, The
callback goes to overriden method
onRequestPermissionResult() of activity with the request
code and result.
● There may be a situation, Where user deny the requested permission.
It may due to not understandable.
● So when the user again interact with the same feature that have been
rejected, We will show a explanation dialog.
● Android provides a utility method
shouldShowRequestPermissionRationale() to overcome the situation.
●
The method returns true, If the app has been requested the permission
earlier and the uses have denied it.
● If the user check Don't ask again, The method will return false.
Handle Permission Request Response
● When your app requests for permission, The system
shows a dialog box to user.
● When user responds onRequestPermissionsResult()
method of activity will call.
● The dialog box shown by the system describes the
permission group your app needs to access instead of
specific permission.
● For instance: If you request the READ_CONTACT
permission, The system dialog show to access device
contacts.
How Android System Ask For Permission
Demo Code Snippets

More Related Content

Viewers also liked

Android webservices
Android webservicesAndroid webservices
Android webservices
Krazy Koder
 
Android security
Android securityAndroid security
Android security
Krazy Koder
 

Viewers also liked (20)

Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - upload
 
Android 6.0 permission change
Android 6.0 permission changeAndroid 6.0 permission change
Android 6.0 permission change
 
Json Tutorial
Json TutorialJson Tutorial
Json Tutorial
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask Tutorial
 
Basic Android Push Notification
Basic Android Push NotificationBasic Android Push Notification
Basic Android Push Notification
 
Android new permission model
Android new permission modelAndroid new permission model
Android new permission model
 
JSON overview and demo
JSON overview and demoJSON overview and demo
JSON overview and demo
 
Simple JSON parser
Simple JSON parserSimple JSON parser
Simple JSON parser
 
App Permissions
App PermissionsApp Permissions
App Permissions
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Android webservices
Android webservicesAndroid webservices
Android webservices
 
Android json parser tutorial – example
Android json parser tutorial – exampleAndroid json parser tutorial – example
Android json parser tutorial – example
 
Android security
Android securityAndroid security
Android security
 
Android - Bluetooth
Android - BluetoothAndroid - Bluetooth
Android - Bluetooth
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
 
Securing android applications
Securing android applicationsSecuring android applications
Securing android applications
 
Webservice for android ppt
Webservice for android pptWebservice for android ppt
Webservice for android ppt
 
Connecting to Web Services on Android
Connecting to Web Services on AndroidConnecting to Web Services on Android
Connecting to Web Services on Android
 
Permission in Android Security: Threats and solution
Permission in Android Security: Threats and solutionPermission in Android Security: Threats and solution
Permission in Android Security: Threats and solution
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
 

Similar to Android permission system

android_mod_3.useful for bca students for their last sem
android_mod_3.useful for bca students for their last semandroid_mod_3.useful for bca students for their last sem
android_mod_3.useful for bca students for their last sem
aswinbiju1652
 
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docx
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docxAndroid Permissions DemystifiedAdrienne Porter Felt, Erika.docx
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docx
durantheseldine
 

Similar to Android permission system (20)

Android Security
Android SecurityAndroid Security
Android Security
 
Android M - Runtime Permissions | Getting ready for Marshmallow
Android M - Runtime Permissions | Getting ready for MarshmallowAndroid M - Runtime Permissions | Getting ready for Marshmallow
Android M - Runtime Permissions | Getting ready for Marshmallow
 
Android Marshmallow APIs and Changes
Android Marshmallow APIs and ChangesAndroid Marshmallow APIs and Changes
Android Marshmallow APIs and Changes
 
Introduction to Android M
Introduction to Android MIntroduction to Android M
Introduction to Android M
 
Request permissions in Android App.pdf
Request permissions in Android App.pdfRequest permissions in Android App.pdf
Request permissions in Android App.pdf
 
Enhancing user privacy by permission removal in android phones
Enhancing user privacy by permission removal in android phonesEnhancing user privacy by permission removal in android phones
Enhancing user privacy by permission removal in android phones
 
Android app code mediator
Android app code mediatorAndroid app code mediator
Android app code mediator
 
A Framework for Providing Selective Permissions to Android Applications
A Framework for Providing Selective Permissions to Android ApplicationsA Framework for Providing Selective Permissions to Android Applications
A Framework for Providing Selective Permissions to Android Applications
 
Permissions
PermissionsPermissions
Permissions
 
android_mod_3.useful for bca students for their last sem
android_mod_3.useful for bca students for their last semandroid_mod_3.useful for bca students for their last sem
android_mod_3.useful for bca students for their last sem
 
Unit - III.pptx
Unit - III.pptxUnit - III.pptx
Unit - III.pptx
 
A journey through android development
A journey through android developmentA journey through android development
A journey through android development
 
Learn more about the Connected Apps | MuleSoft Mysore Meetup #19
Learn more about the Connected Apps | MuleSoft Mysore Meetup #19Learn more about the Connected Apps | MuleSoft Mysore Meetup #19
Learn more about the Connected Apps | MuleSoft Mysore Meetup #19
 
Presentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestatePresentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestate
 
Chapter 2 - Mobile Application Test Types
Chapter 2 - Mobile Application Test TypesChapter 2 - Mobile Application Test Types
Chapter 2 - Mobile Application Test Types
 
ANDROID
ANDROIDANDROID
ANDROID
 
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxMAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
 
Android building blocks and application life cycle-chapter3
Android building blocks and application life cycle-chapter3Android building blocks and application life cycle-chapter3
Android building blocks and application life cycle-chapter3
 
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docx
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docxAndroid Permissions DemystifiedAdrienne Porter Felt, Erika.docx
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docx
 
Ppt 2 android_basics
Ppt 2 android_basicsPpt 2 android_basics
Ppt 2 android_basics
 

Recently uploaded

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 

Recently uploaded (20)

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 

Android permission system

  • 2. Agenda ● Introduction ● Application Sandbox ● Types Of Permission ● Check For Permission ● Request For Permission ● Handle Permission Request Response ● How Android System Ask For Permission
  • 3. Introduction ● To protect android system and user's privacy, Android system runs each application in a limited access sandbox. ● If the app wants to use resources or info outside of its sandbox, The app has to explicitly request permission. ● Earlier all permissions used to set at installation time and can not change untill the reinstallation, but now in new version of android, Permissions are asked at the time of usage. ● In order to grant a permission, It should be declared in the manifest file, The system then evaluates it and make a final decision on whether to grant or deny.
  • 4. Application Sandbox ● The Android system assigns a unique (UID) to each android application and runs it in a separate process. ● Limiting the access of application. ● Any program can ask to Activity Manager to launch other application, which runs with that application's UID. ● For instance A is not allowed to do something malicious, like to read application B's data or dial the phone without permission.
  • 5. Types Of Permission ● Depending on the type of permission that app requests, The system may grant the permission automatically, or ask the user to grant the permission. ● Normal Permissions: Normal permissions do not directly risk the user's privacy, so the system grant the permision automatically. Ex – permission for flashlight. ● Dangerous Permissions: Dangerous permissions can give the access to the user's confidential data, So user has to explicitly give approval to your app. Ex – permission to read contact.
  • 6. Check For Permission ● If your app needs a dangerous permission, You must check every time whether you have permission to perform an operation that require the permission. ● The user is always free to deny the permission, So even if the app used the calander yesterday, It can't be assumed that it still has permission today. ● To check, If the app has permission, Call the method ContextCompact.checkSelfPermission().
  • 7. ● The method will return an integer, You can compare it with PackageManager.PERMISSION_GRANTED or PackageManager.PERMISSION_DENIED. ● See the code snippet: //Assume thisActivity is current Activity int permissionCheck = ContextCompact.checkSelfPermission(thisActivity, Manifest.permission.WRITE_CALENDER);
  • 8. Request For Permission ● If your app doesn't already have the requred permission, The app must call requestPermission() method to request appropriate permission. ● You just need to pass required permission and a request code to identify the permission request as parameter. ● This function works asynchronously. ● After the user responds to the permission dialog box, The callback goes to overriden method onRequestPermissionResult() of activity with the request code and result.
  • 9. ● There may be a situation, Where user deny the requested permission. It may due to not understandable. ● So when the user again interact with the same feature that have been rejected, We will show a explanation dialog. ● Android provides a utility method shouldShowRequestPermissionRationale() to overcome the situation. ● The method returns true, If the app has been requested the permission earlier and the uses have denied it. ● If the user check Don't ask again, The method will return false.
  • 10. Handle Permission Request Response ● When your app requests for permission, The system shows a dialog box to user. ● When user responds onRequestPermissionsResult() method of activity will call. ● The dialog box shown by the system describes the permission group your app needs to access instead of specific permission. ● For instance: If you request the READ_CONTACT permission, The system dialog show to access device contacts.
  • 11. How Android System Ask For Permission