I've already googled this question but haven't found anything yet, so I need your help. How to remove the third option of permission to the memory, because if the user accidentally clicks on it, it will be necessary to go to the settings and allow the permission to the program manually, and since in general 30-40% of users are able to do this, only one will have to reinstall the program .
As people in the comments have said, it is a system dialog and you cannot change it. If you want to help users find your app's settings you can try sending them there.
Also note that according to the docs
Starting in Android 11 (API level 30), if the user taps Deny for a specific permission more than once during your app's lifetime of installation on a device, the user doesn't see the system permissions dialog if your app requests that permission again. The user's action implies "don't ask again."
So you have to deal with permanent denials even if there isn't a dedicated button.
Related
I need to ask for permission from the user. One of the permissions I need is ACTION_MANAGE_OVERLAY_PERMISSION and the other is Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION. When asking for it as you can see in the code below, it takes the user to the Settings screen so the user could tick the permission from there.
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + getPackageName()));
startActivityForResult(intent, OVERLAY_PERMISSION_REQUEST_CODE);
On some Android phones and Android versions, it takes the user straight to the specific application setting (the app that it is called from) on other devices it opens up the list of applications from which the user has to find the app and then tick the permission. In most cases on Androids lower than 10 it opens up the specific app settings window and when it's 10 or higher, it opens up the list.
Is there a way to make it consistently open the current application setting that is open?
I tried adding:
intent.addCategory("android.intent.category.DEFAULT");
intent.setData(Uri.parse("package:" + getApplicationContext().getPackageName()));
But that did not help either.
And secondly, is there a way to ask for this and other Settings permissions without opening the Settings menu and instead of doing it in a dialog inside the application?
If not then is there a way to ask for multiple Settings permissions one after another because my application requires two Settings type permissions.
EDIT
Here is what I meant by the specific application settings vs the list.
On the left picture, all apps are listed and on the right picture the specific app is opened (happens if you click on the app in the list).
Now in some cases, it directly opens the right picture but mostly it opens the left. Is there a way to force open the right picture at all times?
Is there a way to force open the right picture at all times?
No.
The Settings app usually is modified substantially by the device manufacturer. They can do whatever they want. This includes ignoring the Uri or outright removing third-party access to this screen, where the latter is what the documentation is warning against:
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
If you make your own Android firmware, you could ensure that this Intent action behaves as you want, for whatever devices run your firmware.
I wish to promote my app. If a user downloads an app, I would like to know if this is downloaded and opened.
How would you go around doing this?
The question is: how would I know if the user does install my app and open it?
I assume that the key part of "downloaded and opened" is the "and opened" part, correct?
You could just have your activity check some database value (for example) to see if this is the first time that the user opened the app. If so, you could just call a Web Service.
You could actually do that to keep usage statistics in general; you'd probably want to have some kind of explicit opt-in from the user first, though.
Android also has a package for capturing usage statistics.
Because I can't post a comment, I am asking a question instead. I am not a java programmer, but I am wondering if it is possible to turn on the GPS without the user's permission. I found this answer: https://stackoverflow.com/a/33555732. I don't know java, but from what I can see from the comments is that it tries to turn on the GPS and if that doesn't work, it will prompt the user a dialog? Is that correct? Is that code really able to turn on the GPS without the user's permission?
but I am wondering if it is possible to turn on the GPS without the user's permission
No.
but from what I can see from the comments is that it tries to turn on the GPS and if that doesn't work, it will prompt the user a dialog?
Correct.
Is that code really able to turn on the GPS without the user's permission?
No, because the user is giving permission through the dialog. Play Services is enabling GPS based upon the response to the dialog.
You cannot access location without user's permission, because to turn on the GPS you can access user's location. Today you can ask to permission dynamically using Requesting Permission at Run Time, take a look: https://developer.android.com/training/permissions/requesting.html
Is it possible to set android app permission dynamically in java, usually it is set in AndroidManifest.xml. But what I want to do is giving my users a choice of what permissions they want my app to give.
thanks in advance!
No, it is not currently possible. Up through Android Lollipop, permissions must be explicitly requested in the app's manifest and must be collectively all granted or denied (not installing the app) by the user at install time.
Android M, however, is changing this. As of Android M, permissions will be granted at runtime instead of at install time, allowing you to give users more control over which permissions they allow your app to use.
See the Android M runtime permissions documentation for more detail.
At the moment it's not possible http://developer.android.com/guide/topics/security/permissions.html
Android has no mechanism for granting permissions dynamically (at run-time) because it complicates the user experience to the detriment of security.
Things may change in new android M release
Nope. App's permissions are declared in AndroidManifest.xml, which is used to tell Android system what permissions are required. App installer will show all permissions to help user judge the app is good or bad.
Thing about that if an malicious app require nothing at install-time and require camera permission at run-time dynamically
It would be against Android policy . The application has or not has the permissions for doing something . It can be a security problem if you can think of it.
It is possible no issue but in mid of app if not get then chances of getting crash in your app...
I've been looking around for a while to find out what happens when a user fails to unlock the phone.
Basically I'm trying to take a picture if a user fails to authenticate. But all I can find is ACTION_USER_PRESENT - Does anyone know if this is possible?
Thanks
You can't access the login attempts of the android lockscreen.
If you want to build an app that does that you have to create your own lockscreen. However, this is not a "real" lockscreen you can't edit in the android settings. This would be an App which acts like a lockscreen and has the same permissions. Because you can check if a phone is locked, that way the app would activate its own "lockscreen" (which is basically a normal form with many permissions) whenever the phone gets locked (you probably have to deactivate the original lockscreen).
Look into this link, there you have all options regarding the original lockscreen.