question

kkoznjak avatar image
kkoznjak asked Bryanne Vega commented

Android runtime permissions

We have an app that targets API level 27 and is already running on Station 2018 devices (Android API >22). When we release a new version that targets API level 22, will the new version be automatically installed on those devices?
On standard Android devices or emulators running Android API >= 23, an attempt to install new version that targets API <=22 on top of previous version that targets API >= 23 fails with message: "Failure [-26: Package com.mydomain.myapp new target SDK 22 doesn't support runtime permissions but the old target SDK 27 does.]"

EDIT:
Current situation:
We have an app that, among other devices, already runs on Station 2018. The app has a functionality that requires a permission, targets API 27 and doesn't ask for the permission at runtime. Thus the functionality depending on that permission doesn't work on Station 2018.
Target:
We want our app to use functionality requiring the permission on Station 2018 without bothering users by asking them permissions at runtime. To do this we will lower the app's target API level to 22. This means that new version which targets API 22 needs to replace current version which targets API 27 on all Clover devices, including Station 2018.We tested this with Clover Mini (API level 19) and there it works, but we have doubts about Station 2018 because standard Android devices and emulators running API >= 23 don't allow lowering target from API >= 23 to API < 23, because of switching from runtime to install-time permissions model.
Question:
Will new version of our app be able to replace current version on Station 2018, since Clover devices follow grant at install permission model?
Clover Station 2018
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered Bryanne Vega commented
Editing this to reflect question in the edit...

First, none of our devices use Android's runtime permissions, regardless of the SDK level. Our devices differ from stock Android in this way.

Second, I hear what you are saying about downgrading the SDK level, but I couldn't reproduce that. I took the sample project https://github.com/googlesamples/android-RuntimePermissionsBasic/ and installed it as-is targeting SDK 27. I then changed it to use SDK 21 and re-installed without a problem.

EDIT: The above I tested on a Clover device. Testing on an emulator I see the failure. AFAICT you should not have this problem on a Clover device.
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kkoznjak avatar image kkoznjak commented ·

@Jeffrey Blattman, thanks for the answer although it doesn't answer my question, which probably wasn't clear enough. So I'm additionally explaining it in EDIT.

0 Likes 0 ·
Bryanne Vega avatar image Bryanne Vega commented ·

In the 2018 devices, we can't get the Clover Account correctly unless we downgrade the SDK. <= 27, in fact some of my apps HAD to implement runtime permissions.

0 Likes 0 ·

Welcome to the
Clover Developer Community