-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix-gps #537
base: master
Are you sure you want to change the base?
fix-gps #537
Conversation
…ndroid.permission.PERMISSION (as the occur in the standard AndroidManifest.xml).
…, and Manifest from plyer.platforms.android.__init__
This merge repairs GPS on Android, and supports programmatic permissions as mandated by the Android API. A few changes will are required in the gradle build and target API. Namely (and as specified in buildozer.spec): android.api = 29 android.gradle_dependencies = 'com.google.android.gms:play-services-location:17.0.0' I recommend placing these values 'under the hood' so-to-speak, so that the buildozer.spec remains clean.
Hello! Thanks for the pull request. I see you're trying to do something similar to #529, but in the constructor. To request permissions at runtime, you can use
In summary, it seems like a duplicate of #529, unless the example showed in there is not working. |
Fix for programmatically requesting permissions (required for Android API 23 and greater,) particularly for GPS on Android. TL;DR: this makes GPS work again, on Android!
In order for this fix to actually work some other parts of the Kivy framework also require minor patches. As they are specified in buildozer.spec the following values must be set:
android.api = 29
android.gradle_dependencies = 'com.google.android.gms:play-services-location:17.0.0'
It would be nice it could be possible to parse the permissions from buildozer.spec during build, and package it with a text file in the APK, or a simple AndroidManifest.xml parser that plyer could read on initialization. That way, the Manifest list in init could properly be populated with all of the necessary permissions in one place, in case additional endpoints require this patch.