Android app works on 5.0 but not on 6.0 - android

I recently had some beta test for my app. The app works fine on Android 5.0 and even some lower deivices, but not on Android 6.0. Does anybody know what could be an issue here or how one might upgrade their app to support a newer Android OS
Some context about my app:
It uses Firebase auth and database.
Core Use case for this app is getting, sending and showing gps locations on maps.
The problem in Android 6.0 now is that the GPS is not activated when using the app
Thanks in advance

In marshmallow GPS location access is achived by runtime permissions https://developer.android.com/training/permissions/requesting.html
Make sure your permissions are declared in your manifest.xml
If target sdk version is marshmallow ,we need to implement runtime permissions for GPS access.

You need to ask for permissions at runtime in android 6+. This is the reason why no permission is asked when you are installing your application like its asking in android lollipop. Visit android developer page to learn how to ask for permission for android M and above visit : https://developer.android.com/training/permissions/requesting.html

Related

How do I request android runtime permissions the way like in image below?

I found an .apk file and laucnhed on emulator. On start it requests permissions via dialog I have never seen before. I want to create same dialog in my app but I can't find the way dialog below is implemented. I have read many questions on SO and explored some docs but that wasn't I'm looking for. Could you help me to implement request permissions dialog like on the picture?
What you're seeing is permission screen for legacy apps that was added in android 10:
If your app targets Android 5.1 (API level 22) or lower, users see a
permissions screen when using your app on a device that runs Android
10 or higher for the first time, as shown in Figure 1. This screen
gives users the opportunity to revoke access to permissions that the
system previously granted to your app at install time.

React Native location permission doesn't work in Android 10 but does work in Android 9

Issue :
I'm using the react-native-permissions library in my react native app. The code was working perfectly fine in Android devices with OS 9 or below i.e, when prompted to access the device location and if the user grants it the location, the app has access to the device location.
But in Android 10, when the location prompt first appears, and I either select "Allow all the time" or "Allow only while the app is in use", the app is still not able to access the location even though when I check the App info of this app, location shows enabled in the Permissions section.
Now when I turn on the system-wide GPS from the notifications manually, then the app is able to fetch the location.
I don't understand what I'm missing here.
I'm using a Oneplus 6t. Any help would be greatly appreciated.
I had similar issue when working with the location in the Android.
I believe you are using React Native Geolocation which usually used android.location API on android.
This API is not recommended by Google because it is less accurate and slower than the recommended Google Location Services API.
In order to use it with React Native, use the react-native-geolocation-service module. This module has similar looking API and support the latest Android versions. I was able to fix the issue using this package.

How do i use WRITE_SETTINGS in android 5.1 higher version? [duplicate]

This question already has answers here:
How to change denied/granted permission in Android M?
(4 answers)
Closed 6 years ago.
I've developed a app which will automatically create hotsopt when app is opened
The app is working fine in android version 5.1 and below, when i'm trying to install app in android version 6.1 app wasn't showing the permissions which requires and after installing the app, app wasn't opening.
You will need to ask for the required runtime permissions
For reference
How to change denied/granted permission in Android M?
https://developer.android.com/training/permissions/requesting.html
Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app. This approach streamlines the app install process, since the user does not need to grant permissions when they install or update the app. It also gives the user more control over the app's functionality; for example, a user could choose to give a camera app access to the camera but not to the device location. The user can revoke the permissions at any time, by going to the app's Settings screen.

Strange behaviour in Android M Permissions

So I have this app that I made before the Android M came out, the app has permissions such as Camera(using custom camera within the app) Write & Read from external storage and System Alert permission I installed the app to my phone which has android 6.0 and the app was able to run normally and without any restrictions. I was able to use the camera, save files into sdcard & show a custom view using the WindowManager API.
please take a note that the target SDK for the app is android lollipop.
my question: is this even possible? the OS let apps that has target SDK smaller than M to run perfectly without asking for permissions? and if this is actually the default behaviour that android developers implement?
P.S: the identified question is not really applicable for my question. and i don't see any similarity between them at all.
Yes, it is possible. But that can give you a big problem. If the user deactivates some permission your app simple crushes because the permission is no longer available. The OS ask the user "This app was developed for a previous android version. disabling this permission can cause unexpected closing of the app" (ore some thing similar). In conclusion this is the normal behaviour because the android version that you are using to compile your app is before permissions needed to be confirmed by the user.
https://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en
this link explains all you need to now about your question .
Yes, if your app has targetSdkVersion below 23, it will work on M and above without asking any permissions (they will be asked during installation).
But if user will revoke any permission himself, app will crash. It was made by Google to get backwards compatibility with old applications that does not support new Permissions API.
You can read more about it here.
Here is quote from that page:
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.

Get browser history over 6.0 Marshmallow

Is there way to get history on Android 6.0 Marshmallow?
This is intentionally not a supported use case. Using Android SDK's Browser provider right now it doesn't seems to provide history.
Look at this issue https://code.google.com/p/android/issues/detail?id=200685
API >= M ignores the permission argument and instead checks for com.android.chrome.permission.READ_WRITE_BOOKMARK_FOLDERS. This permission is limited to system apps and apps signed with Google's key.
https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-bookmark-browser
Please refer to my answer as mention on below post
https://stackoverflow.com/a/45566687/7895502

Categories

Resources