Now a days you can notice permissions popping up in android marshmallow phones (ver 6.0 android) when you deny permission then you might have notice a error when you try to make a call, read a message, access your contacts, camera, and few more services for your app in Android Marshmallow 6.0 (API level 23).Want to know the reason behind it then this android marshmallow development tutorial is for you.

Android Marshmallow has got some advanced security features so as to make sure that user know what type of permissions a app require while user try to use them i.e., when ever you try to open a app for first time it will ask you few permissions depending upon the app functionality which we will cover in this  android marshmallow tutorial.





Earlier versions of android before to lollipop might have not requested you for permission but are included in android marshmallow features yes its a safety feature for controlling user data from being taken away without any user notice as in earlier cases but now are being controlled in android 6.0 phones. 

By now you might got  an idea what would it look like so you need to few more things as all permissions are not asked in this manner only few are listed out and which are termed to be dangerous permissions and which are to be notified to user and after getting permission will move further.


Want to know more information regarding this topic

Requesting Permissions at Run Time



I will show you how to make a call using a permission window in android marshmallow in this tutorial.


2. Creating :


Here in this tutorial we need not required to design a screen as we are not performing any user clickable functionality as the app starts up it will ask a permission for making a call through the device.


Declare a method call() in which call functionality is implemented.



And in oncreate we will check whether permission is granted or not if not granted we need to ask for permission.



And permission is not granted the we need to request for permission as



Full Code



And when you run this code you will be prompted to accept a permission regarding call and will make a call if you permitted.

 [spacer height=”20px”]

3.  AndroidManifest.xml


Add call permission in manifest file



Show Buttons
Hide Buttons
Read previous post:
Android Play Audio file Tutorial