Commit 0e036b41 authored by Philipp Auersperg's avatar Philipp Auersperg

permission acquisition in python activity

parent 11d88962
......@@ -140,7 +140,7 @@ android.permissions = INTERNET, READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE
# (list) Android AAR archives to add (currently works only with sdl2_gradle
# bootstrap)
#android.add_aars =
android.add_aars = support.aar
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
......
......@@ -3,16 +3,11 @@ print('================================================')
import time
import sys
print('python version is: ', sys.version)
print('python sys.path is: ', sys.path)
# from math import sqrt
# print('import math worked')
# for i in range(45, 50):
# print(i, sqrt(i))
# print('Just printing stuff apparently worked, trying a simple service')
import perms
from jnius import autoclass
# service = autoclass('org.test.testapp_service.ServiceTime')
......@@ -20,7 +15,8 @@ print("before loading service class")
service = autoclass('org.bd.pureservice.ServiceSchas')
mActivity = autoclass('org.kivy.android.PythonActivity').mActivity
print('trying permissions')
mActivity.requestPermissions(['READ_EXTERNAL_STORAGE','WRITE_EXTERNAL_STORAGE'])
# mActivity.requestPermissions(['READ_EXTERNAL_STORAGE','WRITE_EXTERNAL_STORAGE'])
perms.acquire_all_permissions()
argument = 'test argument ok'
print('------before start')
service.start(mActivity, argument)
......
......@@ -39,6 +39,11 @@ def dir(self, **kw):
print ('dir:', res)
return str(res)
@delegate.api
def perms(self, **kw):
import perms
perms.acquire_all_permissions()
def runit():
host = '0.0.0.0'
port = 8077
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment