In Android marshmallow android introduced runtime permissions.
Here my question is Do Android system application such as Camera, Phonebook need to ask for permission like any other non system applications.
Does android system application have some privileges.
Thanks
If you are going to run system applications (by Intent), then you must request the appropriate permissions, except Normal Permissions.
NOTE. And you must remember that the user can at any time revoke the granted permissions.
Related
I am trying to get NFC permission at real time, I am able to get any permission except this one, the only way I am able to achieve this permission is by opening the wireless settings of the phone and asking the user to turn it on, is there a way of asking for this permission in runtime from the app without going to the settings?
thanks!
NFC is listed as Protection level: normal in https://developer.android.com/reference/android/Manifest.permission#NFC
And as per https://developer.android.com/guide/topics/permissions/overview#normal_permissions
If an app declares in its manifest that it needs a normal permission, the system automatically grants the app that permission at install time. The system doesn't prompt the user to grant normal permissions, and users cannot revoke these permissions.
From https://source.android.com/devices/tech/config/runtime_perms are only for permissions classed as dangerous
Therefore you don't need runtime permissions to use NFC
But it sounds like you are trying to get permission to turn NFC ON or OFF programmatically which is not really possible
See https://stackoverflow.com/a/11195440/2373819
At least in my two xiaomi's phones when I install my app, it doesn't have all notifications permission (only vibrate, badge and lock screen) like in the pic.
What can I do to in my app to have all the notification permissions enabled by default?
Thanks!
Starting from android 6.0 marshmallow you need to manually give permissions for security reasons. If the application isn't written in such way that it checks for permissions and asks for them, then you can't get them enabled by default(without going to settings).
You need to manually ask for permission for Android 6.0 and above. More informations :
Request App Permissions
I am developing an app that does some admin operations on android devices.
The users of android devices running on marshmallow and later has the ability to disable or enable the permissions for a particular app, and I want to restrict the user from disabling my app's permissions since it is an admin app and it need the permissions to run the app.
Is there anyway to restrict enabling/disabling permissions particularly for apps with device administrator privileges?
You Cannot restrict a user from enabling and/or disabling permissions on devices above Marshmallow.
The Only thing you can do is just check if the user has disabled the permission then either explain him why your app needs the permissions and if he is still not giving permissions then don't let him enter the app.
You can check at start of app whether the user has disabled your permission using
ContextCompat.checkSelfPermission(context, permission);
It will return -1 if the permission is not available.
No, This is not under the legal standard of android,
you have to check permission on your app at Splash or First Screen that your app has access that permission or not for move further.
android permission dialog is not showing in lollipop version I.e 5.1, but permission dialog is showing in version 6.0 ie marshmallow. Can any one tell me what is the reason behind this, and how to solve this problem.
For below Android 6.0 permission dialog will not shown to the user.
From Android Docs:
If the device is running Android 5.1 or lower, or your app's target SDK is 22 or lower: If you list a dangerous permission in your
manifest, the user has to grant the permission when they install the
app; if they do not grant the permission, the system does not install
the app at all.
If the device is running Android 6.0 or higher, and your app's target SDK is 23 or higher: The app has to list the permissions in the
manifest, and it must request each dangerous permission it needs while
the app is running. The user can grant or deny each permission, and
the app can continue to run with limited capabilities even if the user
denies a permission request.
Can any one tell me what is the reason behind this
Assuming that you mean the runtime permission dialog triggered by requestPermissions(), the reason is that this dialog exists only on Android 6.0+. ActivityCompat.requestPermissions(), ContextCompat.checkSelfPermission(), and related methods call their native equivalents on Android 6.0 devices and fail gracefully on older devices.
how to solve this problem.
There is no problem. Runtime permissions only exist on Android 6.0+. On Android 1.0-5.1 devices, permissions are granted purely at install time.
I list all permissions of the new installed application on Android device. But I want to detect when an application uses these permission. For example, I installed an app and it uses READ_CALENDAR permission. It is not always read my calendar data. I want to detect the time it reads my calendar data. Is it possible?
No, I don't think this is possible. You would need to be able to monitor each external app, and you don't have the ability to know what they are doing (due to security restrictions on Android). In other words, your app doesn't have the ability to monitor the actions of other apps (not written by you) on the device.
I don't think you have access to the system at the level you would need to perform this (this may be possible on a Rooted phone, but I think that would still be difficult).
When you write an app you have to insert in the android manifest all the possible "uses permissions", for all the functionality that your app will use.
When someone installs your app, before the installation procedure, he can read all the permissions used from the app. If you accept to install it, the app will use all those permissions listed.