mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Android build updates
This commit is contained in:
parent
0c6aa7e1b8
commit
ac77fe9e1e
5 changed files with 33 additions and 17 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -24,7 +24,7 @@ PySolFC-Cardsets-2.0/
|
||||||
android/*.apk
|
android/*.apk
|
||||||
android/*.zip
|
android/*.zip
|
||||||
android/bin/keystore
|
android/bin/keystore
|
||||||
buildozer/.buildozer
|
buildozer/.buildozer*
|
||||||
buildozer/PySolFC-Cardsets*
|
buildozer/PySolFC-Cardsets*
|
||||||
buildozer/bin
|
buildozer/bin
|
||||||
buildozer/tmp
|
buildozer/tmp
|
||||||
|
|
|
@ -52,7 +52,7 @@ presplash.filename = %(source.dir)s/data/images/logo-with-margin-1024.png
|
||||||
icon.filename = %(source.dir)s/data/images/icons/48x48/pysol.png
|
icon.filename = %(source.dir)s/data/images/icons/48x48/pysol.png
|
||||||
|
|
||||||
# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)
|
# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)
|
||||||
orientation = all
|
orientation = portrait, landscape
|
||||||
|
|
||||||
# (list) List of service to declare
|
# (list) List of service to declare
|
||||||
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY
|
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY
|
||||||
|
@ -96,6 +96,7 @@ fullscreen = 1
|
||||||
|
|
||||||
# (list) Permissions
|
# (list) Permissions
|
||||||
#android.permissions = INTERNET
|
#android.permissions = INTERNET
|
||||||
|
android.permissions = INTERNET, WRITE_EXTERNAL_STORAGE
|
||||||
|
|
||||||
# (list) features (adds uses-feature -tags to manifest)
|
# (list) features (adds uses-feature -tags to manifest)
|
||||||
#android.features = android.hardware.usb.host
|
#android.features = android.hardware.usb.host
|
||||||
|
@ -312,6 +313,7 @@ android.debug_artifact = apk
|
||||||
|
|
||||||
# (str) python-for-android specific commit to use, defaults to HEAD, must be within p4a.branch
|
# (str) python-for-android specific commit to use, defaults to HEAD, must be within p4a.branch
|
||||||
#p4a.commit = HEAD
|
#p4a.commit = HEAD
|
||||||
|
p4a.commit = v2023.02.10
|
||||||
|
|
||||||
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
|
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
|
||||||
#p4a.source_dir =
|
#p4a.source_dir =
|
||||||
|
@ -388,7 +390,7 @@ ios.codesign.allowed = false
|
||||||
[buildozer]
|
[buildozer]
|
||||||
|
|
||||||
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
|
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
|
||||||
log_level = 1
|
log_level = 2
|
||||||
|
|
||||||
# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
|
# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
|
||||||
warn_on_root = 1
|
warn_on_root = 1
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
attrs
|
appdirs==1.4.4
|
||||||
buildozer
|
attrs==22.2.0
|
||||||
configobj
|
-e git+https://github.com/kivy/buildozer.git@3ebc09e885457db4747e67a1250c2aea1ca7a046#egg=buildozer
|
||||||
Cython
|
colorama==0.4.6
|
||||||
Kivy
|
configobj==5.0.8
|
||||||
pep8
|
Cython==0.29.33
|
||||||
permutation
|
Jinja2==3.1.2
|
||||||
pip
|
Kivy==2.1.0
|
||||||
pysol-cards
|
pep517==0.13.0
|
||||||
python-for-android
|
pep8==1.7.1
|
||||||
setuptools
|
permutation==0.4.0
|
||||||
wheel
|
pip==23.0.1
|
||||||
|
pysol-cards==0.14.3
|
||||||
|
setuptools==67.0.0
|
||||||
|
toml==0.10.2
|
||||||
|
wheel==0.38.4
|
||||||
|
|
|
@ -27,6 +27,9 @@ class AndroidPerms(object):
|
||||||
'androidx.core.content.ContextCompat')
|
'androidx.core.content.ContextCompat')
|
||||||
self.currentActivity = jnius.cast(
|
self.currentActivity = jnius.cast(
|
||||||
'android.app.Activity', self.PythonActivity.mActivity)
|
'android.app.Activity', self.PythonActivity.mActivity)
|
||||||
|
self.build = jnius.autoclass("android.os.Build")
|
||||||
|
self.version = jnius.autoclass("android.os.Build$VERSION")
|
||||||
|
self.vcodes = jnius.autoclass("android.os.Build$VERSION_CODES")
|
||||||
|
|
||||||
def getPerm(self, permission):
|
def getPerm(self, permission):
|
||||||
if jnius is None:
|
if jnius is None:
|
||||||
|
@ -54,12 +57,19 @@ class AndroidPerms(object):
|
||||||
|
|
||||||
def getStoragePerm():
|
def getStoragePerm():
|
||||||
ap = AndroidPerms()
|
ap = AndroidPerms()
|
||||||
|
# print('Android API version: ', ap.version.SDK_INT)
|
||||||
|
logging.info("androidperms: API version %d" % (ap.version.SDK_INT))
|
||||||
|
if ap.version.SDK_INT > 29:
|
||||||
|
return False
|
||||||
return ap.getPerms(
|
return ap.getPerms(
|
||||||
["android.permission.WRITE_EXTERNAL_STORAGE"])
|
["android.permission.WRITE_EXTERNAL_STORAGE"])
|
||||||
|
|
||||||
|
|
||||||
def requestStoragePerm():
|
def requestStoragePerm():
|
||||||
ap = AndroidPerms()
|
ap = AndroidPerms()
|
||||||
|
logging.info("androidperms: API version %d" % (ap.version.SDK_INT))
|
||||||
|
if ap.version.SDK_INT > 29:
|
||||||
|
return
|
||||||
# ap.requestPerms(
|
# ap.requestPerms(
|
||||||
# ["android.permission.READ_EXTERNAL_STORAGE","android.permission.WRITE_EXTERNAL_STORAGE"])
|
# ["android.permission.READ_EXTERNAL_STORAGE","android.permission.WRITE_EXTERNAL_STORAGE"])
|
||||||
ap.requestPerms(
|
ap.requestPerms(
|
||||||
|
|
|
@ -221,7 +221,7 @@ class PysolAboutDialog(object):
|
||||||
logging.info('PysolAboutDialog: txt=%s' % text)
|
logging.info('PysolAboutDialog: txt=%s' % text)
|
||||||
|
|
||||||
text = text + '\n\n' + 'Adaptation to Kivy/Android\n' + \
|
text = text + '\n\n' + 'Adaptation to Kivy/Android\n' + \
|
||||||
' Copyright (C) (2016-19) LB'
|
' Copyright (C) (2016-23) LB'
|
||||||
|
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.app = app
|
self.app = app
|
||||||
|
|
Loading…
Add table
Reference in a new issue