Open Andrukva opened 2 years ago
Android Permissions would be needed to be granted for various plyer/pyjnius features - for flash(light) have you requested CAMERA
permission?
Otherwise could you get a crash report via logcat - to see a reason for the crash.
I requested permission when assembling in a bulldozer, as shown in the example.
I requested permission for both the camera and the flashlight.
Just checked and flash.on()
and flash.off()
runs fine here on Android 11. Did you request camera at runtime ie within the app.
If not you can do so manually with your current app in Settings > Apps
Otherwise again - would ideally want to see the log report.
Could you show me what code you tried?
Strangely, my application is not in the list of applications that are allowed or not allowed to use the camera. Although in the specification of the bulldozer I specified both the camera and the flash
I think this issue was solved by this pull request #716
Tested under android 5.
If you want to test change the requirements in your buildozer.spec
requirements = kivy, git+https://github.com/oukiar/plyer.git
and do buildozer android clean
best regards
Some updates, today i was able to test in android 9 and my surprise is that using the legacy camera api not work.
For get working the flashlight was added code for use the CameraManager (newer api) now it is working and tested on android 9 device, maybe will work on other android versions, tests are necesary.
Please tell me how to turn on the flashlight on a phone with Android 9 using plyer and kivy/switch or kivy/button. Those examples that exist do not work. The application starts, but as soon as I press the button to turn on the flashlight, the application closes. Please show me how to do it correctly. Thank you in advance!