from android.permissions import request_permissions, Permission
request_permissions([Permission.READ_EXTERNAL_STORAGE, Permission.WRITE_EXTERNAL_STORAGE])
Note: Also make sure to give the permission in .spec file also.Then only it will work.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/1521103a-9f3c-42a3-806e-1a52b1aaed24o%40googlegroups.com.
Yup the same issue i faced two years back.The solution would be like just add this in your main loopfrom android.permissions import request_permissions, Permission request_permissions([Permission.READ_EXTERNAL_STORAGE, Permission.WRITE_EXTERNAL_STORAGE])
Note: Also make sure to give the permission in .spec file also.Then only it will work.
On Mon, Nov 2, 2020 at 8:50 PM Degenerate Tech <sksah...@gmail.com> wrote:
i have written kivy app it working well in android ..but when i have added two lines below--from android.permissions import request_permissions, Permissionrequest_permissions([Permission.WRITE_EXTERNAL_STORAGE])app in android crashing .please help
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/cd576381-8c61-42f6-a73c-ce9a8557eaaco%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/ba56ce41-7418-4017-b67d-a6df69e285d1o%40googlegroups.com.
You're welcome :)
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/ba56ce41-7418-4017-b67d-a6df69e285d1o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/0afcfac5-befc-43fd-ad0a-797343f5865ao%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/0afcfac5-befc-43fd-ad0a-797343f5865ao%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/4f381a68-d8ac-4fa9-b1dc-c33cf922da9co%40googlegroups.com.
#####some modification need
https://github.com/kivy/plyer/issues/383
Yes, now there is now problem and no "import plyer" error when running on my android device. However, it seems that my Android 6.0.1 does not accept WRITE_SETTINGS permission so easily. The app crashes as soon as trying to use brightness.set_level() or brightness.current_level() in the example. No problem if I comment out the lines using those.
I found on the Web the following:
"To use WRITE_SETTINGS, based on the docs:
Have the element in the manifest as normal.
Call Settings.System.canWrite() to see if you are eligible to write out settings.
If canWrite() returns false, start up the ACTION_MANAGE_WRITE_SETTINGS activity so the user can agree there to allow your app to actually write to settings."
How can this be implemented in Kivy?
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/4f381a68-d8ac-4fa9-b1dc-c33cf922da9co%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/0f6cef47-22d3-4098-b4c0-a5065628895do%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/0f6cef47-22d3-4098-b4c0-a5065628895do%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/804b4ed0-c636-4233-9bca-bf7f6dbdce3eo%40googlegroups.com.
####can you modify this code ?see yellow portion
from jnius import autoclass
from plyer.facades import Brightness
from android import mActivity
System = autoclass('android.provider.Settings$System')
class AndroidBrightness(Brightness):
def _current_level(self):
System.putInt(
mActivity.getContentResolver(),
System.SCREEN_BRIGHTNESS_MODE,
System.SCREEN_BRIGHTNESS_MODE_MANUAL)
cr_level = System.getInt(
mActivity.getContentResolver(),
System.SCREEN_BRIGHTNESS)
return (cr_level / 255.) * 100
def _set_level(self, level):
System.putInt(
mActivity.getContentResolver(),
System.SCREEN_BRIGHTNESS,
(level / 100.) * 255)
def instance():
return AndroidBrightness()
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/804b4ed0-c636-4233-9bca-bf7f6dbdce3eo%40googlegroups.com.