Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which permission do we need at runtime in android 6.0

I have an android code which can work well on Android 5.0 version. My AndroidManifest.xml is

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />

However, my customer who uses Android 6.0 (LG G5) reported the application does not work well. I do not have LG G5 to check what is the issue. In my opinion, I think the reason is that the permission changed from 5.0 to 6.0. Could you look at my permission and give me some improve/correct it for Android 6.0? Or do we have any way to automatically add permission for Android 6.0. Thank all

like image 272
Jame Avatar asked Aug 16 '16 10:08

Jame


People also ask

What are runtime permissions in Android?

Runtime permissions prevent apps from gaining access to private data without a user's consent, and provide them with additional context and visibility into the types of permissions that applications are either seeking, or have been granted.

Which Android introduced the runtime permission?

From beginning with Android 6.0 Marshmallow (API LEVEL 23)( Marshmallow was released on October 5, 2015), Google has introduced a new runtime permission model. Users can then allow or deny the permission, users can also grant or revoke permission anytime from settings even if the app is already installed.

What app permissions should I allow?

Only give your Android apps permission to access what they need to access on your device to provide the functionality you require from them. For example, it's natural that your weather app or navigation app will need access to your location to function properly.

What is the need of permission in Android?

Android app permissions can give apps control of your phone and access to your camera, microphone, private messages, conversations, photos, and more. App permission requests pop up the first time an app needs access to sensitive hardware or data on your phone or tablet and are usually privacy-related.


1 Answers

In Android 6.0, this includes:

ACCESS_COARSE_LOCATION
ACCESS_FINE_LOCATION
ADD_VOICEMAIL
BODY_SENSORS
CALL_PHONE
CAMERA
GET_ACCOUNTS
PROCESS_OUTGOING_CALLS
READ_CALENDAR
READ_CALL_LOG
READ_CELL_BROADCASTS
READ_CONTACTS
READ_EXTERNAL_STORAGE
READ_PHONE_STATE
READ_SMS
RECEIVE_MMS
RECEIVE_SMS
RECEIVE_WAP_PUSH
RECORD_AUDIO
SEND_SMS
USE_SIP
WRITE_CALENDAR
WRITE_CALL_LOG
WRITE_CONTACTS
WRITE_EXTERNAL_STORAGE

For these permissions, not only does your targetSdkVersion 23+ app need to have the element(s), but you also have to ask for those permissions at runtime from the user on Android 6.0+ devices, using methods like checkSelfPermission() and requestPermissions().

How to ask permission link

like image 184
Yogesh Rathi Avatar answered Oct 04 '22 12:10

Yogesh Rathi