0

I've tried reading the documentation for jnius but it doesn't provide much help for beginners.

I want my program to be able to read sms, but that isn't available in plyer yet, hence I have to use jnius and I'm having problems granting permission.

import kivy
from kivy.app import App
from kivy.uix.label import Label

from jnius import autoclass
from android.permissions import request_permissions, Permission

import android

PythonActivity = autoclass('org.kivy.android.PythonActivity')

request_permissions([Permission.READ_SMS])

It keeps on throwing

jnius.jnius.JavaException: Class not found b'org/kivy/android/PythonActivity$PermissionsCallback'
  • Does pydroid have the read_sms permission? If not, you cannot request it at runtime – inclement Feb 02 '21 at 19:52
  • Seems to be complaining about `callback`. The `request_permissions()` can accept a `callback`, perhaps you should try providing one. The static method signature is `def request_permissions(cls, permissions, callback=None):`. The callback will be called with arguments of 'permissions' and 'grant_results'. – John Anderson Feb 02 '21 at 21:22

0 Answers0