SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The BasicsMike Desjardins
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development pptGautam Kumar
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installationPoojaBele1
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidzeelpatel0504
 
Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in androidPrawesh Shrestha
 
Android summer training report
Android summer training reportAndroid summer training report
Android summer training reportShashendra Singh
 
Android resources
Android resourcesAndroid resources
Android resourcesma-polimi
 
Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)ejlp12
 
Introduction to Mobile Development
Introduction to Mobile DevelopmentIntroduction to Mobile Development
Introduction to Mobile DevelopmentPragnesh Vaghela
 
Android testing
Android testingAndroid testing
Android testingJinaTm
 
Ii 1500-publishing your android application
Ii 1500-publishing your android applicationIi 1500-publishing your android application
Ii 1500-publishing your android applicationAdrian Mikeliunas
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Developmentdonnfelker
 

Mais procurados (20)

Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The Basics
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development ppt
 
Fragment
Fragment Fragment
Fragment
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installation
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android Threading
Android ThreadingAndroid Threading
Android Threading
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android seminar ppt
Android seminar pptAndroid seminar ppt
Android seminar ppt
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in android
 
Android summer training report
Android summer training reportAndroid summer training report
Android summer training report
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating System
 
Android resources
Android resourcesAndroid resources
Android resources
 
Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)
 
Introduction to Mobile Development
Introduction to Mobile DevelopmentIntroduction to Mobile Development
Introduction to Mobile Development
 
Windows Phone PPT
Windows Phone PPTWindows Phone PPT
Windows Phone PPT
 
Android testing
Android testingAndroid testing
Android testing
 
Ii 1500-publishing your android application
Ii 1500-publishing your android applicationIi 1500-publishing your android application
Ii 1500-publishing your android application
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 

Destaque

Anatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shopAnatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shopAbhinav Mishra
 
Security threats in Android OS + App Permissions
Security threats in Android OS + App PermissionsSecurity threats in Android OS + App Permissions
Security threats in Android OS + App PermissionsHariharan Ganesan
 
Tips dan Third Party Library untuk Android - Part 1
Tips dan Third Party Library untuk Android - Part 1Tips dan Third Party Library untuk Android - Part 1
Tips dan Third Party Library untuk Android - Part 1Ibnu Sina Wardy
 
Android permission system
Android permission systemAndroid permission system
Android permission systemShivang Goel
 
Android training day 4
Android training day 4Android training day 4
Android training day 4Vivek Bhusal
 
Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009sullis
 
Sandbox Introduction
Sandbox IntroductionSandbox Introduction
Sandbox Introductionmsimkin
 
Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - uploadBin Yang
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask TutorialPerfect APK
 
Android 6.0 permission change
Android 6.0 permission changeAndroid 6.0 permission change
Android 6.0 permission change彥彬 洪
 
Simple JSON parser
Simple JSON parserSimple JSON parser
Simple JSON parserDongjun Lee
 
Android webservices
Android webservicesAndroid webservices
Android webservicesKrazy Koder
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
Android json parser tutorial – example
Android json parser tutorial – exampleAndroid json parser tutorial – example
Android json parser tutorial – exampleRajat Ghai
 

Destaque (20)

Anatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shopAnatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shop
 
Android(1)
Android(1)Android(1)
Android(1)
 
Security threats in Android OS + App Permissions
Security threats in Android OS + App PermissionsSecurity threats in Android OS + App Permissions
Security threats in Android OS + App Permissions
 
Tips dan Third Party Library untuk Android - Part 1
Tips dan Third Party Library untuk Android - Part 1Tips dan Third Party Library untuk Android - Part 1
Tips dan Third Party Library untuk Android - Part 1
 
Android permission system
Android permission systemAndroid permission system
Android permission system
 
Android training day 4
Android training day 4Android training day 4
Android training day 4
 
Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009
 
Sandbox Introduction
Sandbox IntroductionSandbox Introduction
Sandbox Introduction
 
Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - upload
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask Tutorial
 
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
 
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 webservices
Android webservicesAndroid webservices
Android webservices
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Android json parser tutorial – example
Android json parser tutorial – exampleAndroid json parser tutorial – example
Android json parser tutorial – example
 

Semelhante a Android permission system

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 MarshmallowUmair Vatao
 
Android Marshmallow APIs and Changes
Android Marshmallow APIs and ChangesAndroid Marshmallow APIs and Changes
Android Marshmallow APIs and ChangesMalwinder Singh
 
Introduction to Android M
Introduction to Android MIntroduction to Android M
Introduction to Android Mamsanjeev
 
Request permissions in Android App.pdf
Request permissions in Android App.pdfRequest permissions in Android App.pdf
Request permissions in Android App.pdfMaria440434
 
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 phonesRumana Firdose
 
Android app code mediator
Android app code mediatorAndroid app code mediator
Android app code mediatorFatimaYousif11
 
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 ApplicationsIOSR Journals
 
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 semaswinbiju1652
 
A journey through android development
A journey through android developmentA journey through android development
A journey through android developmentraditya gumay
 
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 #19MysoreMuleSoftMeetup
 
Android security
Android securityAndroid security
Android securityKrazy Koder
 
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 instancestateOsahon Gino Ediagbonya
 
Chapter 2 - Mobile Application Test Types
Chapter 2 - Mobile Application Test TypesChapter 2 - Mobile Application Test Types
Chapter 2 - Mobile Application Test TypesNeeraj Kumar Singh
 
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxMAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx34ShreyaChauhan
 
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-chapter3Dr. Ramkumar Lakshminarayanan
 
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.docxdurantheseldine
 

Semelhante a 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
 
Android security
Android securityAndroid security
Android security
 
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
 

Último

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 workingrknatarajan
 
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.pdfankushspencer015
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
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.pptxfenichawla
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
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...Call Girls in Nagpur High Profile
 
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...Christo Ananth
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
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 engineeringmulugeta48
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 

Último (20)

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
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
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
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
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...
 
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...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
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
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 

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