Stop language changes in app after locale changes - java

I use a runtime permission library called Kpermission to request permission, but the issue is the permission request follows device language and not app language

You can't. Instead of changing better you display your custom dialog before requesting permission to explain you the purpose of permission
You can check this link https://developer.android.com/training/permissions/requesting.html
Note: Your app cannot customize the dialog that appears when you call launch(). To provide more information or context to the user, change your app's UI so that it's easier for users to understand why a feature in your app needs a particular permission. For example, you might change the text in the button that enables the feature.
Also, the text in the system permission dialog references the permission group associated with the permission that you requested. This permission grouping is designed for system ease-of-use, and your app shouldn't rely on permissions being within or outside of a specific permission group.
Example Custom Dialog Permission

Related

Request Background location permission settings tab in android 11

in android 11 (API 30) you can't request the permission ACCESS_BACKGROUND_LOCATION directly from the requestPermissions() method.. and instead, you need to enable it from the settings.
On the Android Developers website: https://developer.android.com/training/location/permissions
they say you can call getBackgroundPermissionOptionLabel() to get the settings label of the location permission.
The documentation is limited and lacks specification of the getBackgroundPermissionOptionLabel() method and I don't know what to do.
Does anyone know how to use this method?
getBackgroundPermissionOptionLabel() gives you a localized string that you can use to get the label of the option to "Allow all the time".
It is quite hard to request background location permission and dealing with the order of the permissions, rationales, and permanent denials. I would suggest having a look at the library I have been working on for a while for asking for permissions where this is included: https://github.com/warting/permissions-ui

Directly Enable Permission Like Location

I can implement Runtime permission where a dialog appears to the user to allow the permission or deny the permission. But I want The permission will be enabled or allowed in the background without asking the User. Is it possible? is it possible then how to do it? Please explain in Java (Android studio).
in the background without asking the User. Is it possible?
no.
this defeats the point of the permission model - if any random app could just get your location (or any other sensitive permission) without requesting for it, why would apps even bother to implement runtime permissions ?

Android permissions: asking options guide

I apologize in advance for my language and if this thread is a duplicate.
I would like to ask for a 'mini-guide' on android permission asking for 6.0+. The problem that I am personally having is some applications I recently released require permissions like internet and external storage. But the only way I could 'help' the user from going manually to settings -> app settings etc, is launching an intent on button press for the app setting page.
So what I am asking is:
For newest versions of Android (assuming it will work on most older versions too),
is there a way to:
Ask for every permission you need to be accepted before downloading on Play Store and then enabled by default?
Ask on first time app launch to give permanent permissions to app and on positive response, programmatically enable them?
Ask the user for a one-time, dynamic, TEMPORARY, permission request. For example, app1 does not have permission to write to an external storage. On button1 press, ask temporary permission to write to a file in the external storage. If the user clicks button1 again, permission will be asked again.
Again, apologies if this question has been asked before. I want to assure you I did a lot of research, and most of the answers I found didn't seem to work...
Thanks
1) I think its not possible to enable all permissions by default since its a major update in Android 6+ devices to enable users to control runtime permissions the app needed.
For 2 & 3)
For my project I have written a static java class to request android runtime permissions. You can use that if you want. You have to add other permissions as you need in the same pattern as described in the class.
I have provided the Github link below
Github

Android Dev Q Regarding Permission Request

Hey all!
So as Android Devs know, Android M introduced a new Permissions system.. I am nearing the end stages of Coding my App, and implementing this Permission Request is one of my final tasks. I just have a few quick questions about the way it works..
Upon starting my App for the first time, the user see's a Welcome screen, with a view pager type of interface with 4 pages containing information about using the App.. The last page will explain to the user that the App needs a Permission to be granted in order to use the App, and upon clicking a "Lets get Started" Button, I will have the Permission Request pop up..
Here are my Questions:
(1) - Am I actually able to Request the Permission on the fly like I descibed above, to be used later at some point, before I actually need to use the Permission? or am I limited to Requesting the Permission at specific times, such as when I actually need it, or at runtime, etc..?
(2) - Once the user Grants the Permission I Request, is it permanent? or will I need to Request Permission yet again if for example they reboot their phone etc?
Huge thanks for the information!
You can request for Marshmallow permissions at any point of time, they are not limited.
Yes, once the user grants the permission it is permanent, so no pop up will need to be generated. Although the user will still be able to manually remove the permission from the Settings app, which will require you to ask for it again next time you'll need it.

Android Preference-Specific Permission Requests

Is there a way to request a specific permission only when the user enables a certain preference?
In my case, I have an option to sync with the calendar to add dates and set reminders (to my knowledge, you can't set reminders in the calendar with Intents). Obviously I need permission to access the calendar, but ONLY when the user enables this option. I'd like to, when the user enables the preference, request permission, then disable the option if permission isn't granted.
No. Unfortunately there is no option to do that.
No checks with the user are done while an application is running: it either was granted a particular permission when installed, and can use that feature as desired, or the permission was not granted and any attempt to use the feature will fail without prompting the user.
http://developer.android.com/guide/topics/security/permissions.html
This is possible since Marshmallow. See video showing best practice to ask for permission from Android Marshmallow
You can find snippets of code allowing you to do this at Android developer guide to requesting permission for Marshmallow and above

Categories

Resources