Strategy to implement an "optional" location permission - android

I'm developing an app that would benefit from coarse location data, but the nature of this app is such that many users would have privacy concerns if location permission would be mandatory
I'm hoping to find a way to provide both options (with and without location perms).
AFAIK there is no way to enable location perms programmatically in Android.
All I can think of is to publish two separate app versions in Google Play but I'm not very excited about "splitting" the download and rating stats between them and the potential development overhead.
Do you have any ideas to handle this another way or how to make the separate app option as painless as possible?

For future reference:
It is now possible with the new Android M runtime permissions.
The permissions still have to be defined in manifest, so, to avoid enforcing the permission for users with older android versions, use the new <uses-permission-sdk23 /> element

Related

Android Application Permissions Logging

i have a question related to Android app run time permissions.
Is it preferrable/allowed practice for developers to save users' permission preferences i.e. each user has allowed/denied any permission, on our remote server database?
Offcourse we are asking run time permission for every feature we want to use, but is it preferrable that we log on server that if user has allowed for any permission or not, please let know. Thanks
Android framework has restricted the developers to ask only those permissions which are necessary to implement a specific feature and that too if there's no other way to implement the feature without that specific permission. In your case, it seems like you have already taken care of the permissions and just want to hold the result of the asked permissions.
So the answer is YES, You can save this data and it's even considered good practice for handling permissions. Here's the reference from the official android documentation.
Greater flexibility in granting permissions
Users can deny access to individual permissions at the time they’re requested and in settings, but they may still be surprised when functionality is broken as a result. It’s a good idea to monitor how many users are denying permissions (e.g. using Google Analytics) so that you can either refactor your app to avoid depending on that permission or provide a better explanation of why you need the permission for your app to work properly. You should also make sure that your app handles exceptions when users deny permission requests or toggle off permissions in settings.
https://developer.android.com/training/permissions/usage-notes

Mock Locations on Android 12

I am testing an app that uses geofencing and I need to be able to specify mock locations. In my research I found old posts (5 years) talking about using Allow Mock Locations in developer options but that seems to only be in older versions of Android. Now I see a place to specify a mock location app but no way to specify one. I looked at code samples to create a mock location app but the permission that has to be set (ACCESS_MOCK_LOCATION) appears to be only valid for system apps. Is there no way to do this anymore without rooting?
Firstly, the apps that acquire ACCESS_MOCK_LOCATION appear in developer options, which means you will be able to select your app as a mock location app when you add-in manifest
Secondly, ACCESS_MOCK_LOCATION is not a system app permission. So there is no need for rooting the device or marking your app as a system app etc.

Releasing app that uses different permissions for different Android versions on the Google Play store?

Our app is trying to follow the new Designed for Children policy, which requires not requesting location permissions: https://support.google.com/googleplay/android-developer/answer/9893335?hl=en
We require bluetooth, and request location permissions in order to connect to bluetooth. In order to not have our app removed from the play store, we are supposed to remove the location permission request and switch to CompanionDeviceManager. However, CompanionDeviceManager is only available in API 26+, and we have many users on older versions.
Is there a way for us to release a different APK for phones on 25- vs on 26+? Does the Play store have any support for this, or would we have to basically maintain 2 separate apps on the play store? I know that you can usually branch in the source code based on version, but I haven't seen that it's possible to branch on what permissions are in the manifest.
I'm not entirely certain how this interacts with the Designed for Children policy, but there's actually a much easier way to target permissions to specific SDK versions than creating multiple APKs: the android:maxSdkVersion property on the <uses-permission> tag. You could simply set android:maxSdkVersion="25" on the location permission, and your app should no longer ask for that permission on API 26+.

Getting Warning on Play Store for using WRITE_CALL_LOG permission in android app

I'm working on a project based on cloud backup which saves and restore user's call log. It was working fine for the previous version but now getting following warning. I added a description before taking permission from the user but still getting the warning.
Your app is requesting the following permission which is used by less
than 1% of functionally similar apps: WRITE_CALL_LOG
Users prefer apps that request fewer permissions and requesting
unnecessary permissions can affect your app's visibility on the Play
Store. If these permissions aren't necessary, you may be able to use
alternative methods in your app and request fewer permissions. If they
are, we recommend providing an explanation to users of why you need
the permissions. Learn more
Note: This guidance is based on a comparison with functionally similar
apps, which change over time as new apps get published and existing
apps change behavior. Therefore the warning may change even if you
don't change your permission usage.
Its a warning. If you need that permission (and it seems your app does), then you're fine. If you didn't really need it, you should remove it. Google isn't going to scan your description to see if you explain it, that level of AI isn't really possible yet. So you'll continue to get the warning.

Can an in-app purchase add one specify an additional permission?

Here's my scenario:
Currently, my app does NOT require the INTERNET permission and I would love to keep it that way. My app is a financial app where a lot of users don't want to take a chance on an app that can send their data out.
Now, I would like to have some kind of add-on that enables some on-line features, such as DropBox sync and some others which will require the INTERNET permission.
Can an app's add-on request additional permissions, and if not, can anybody suggest a reasonable way to accomplish this?
Thank you!
The suggested answer is to use a sharedUserId in the AndroidManifest and then create a new app with the added permission and this same user ID. This works great for apps where the developer had foreseen this need, but for other apps, adding or changing the sharedUserId causes it to misbehave.
Here's the corresponding Google bug, please star it if you feel this should be addressed:
http://code.google.com/p/android/issues/detail?id=14074
I had a different problem I was trying to solve and decided on add-ons also. The solution I used was to implement the Shared User Id paradigm. My add-on has the same signature, no launcher intent (which means there will be no separate icon on the users device) and a signature based security on the activity calls. This will allow you to implement the above functionality.
The issue you may have is I doubt you can get another application installed using in app purchases. You may need to sell the add-on as a separate app.
Hope this helps...

Categories

Resources