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
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -24,11 +24,11 @@ PySolFC-Cardsets-2.0/
|
|||
android/*.apk
|
||||
android/*.zip
|
||||
android/bin/keystore
|
||||
buildozer/.buildozer
|
||||
buildozer/.buildozer*
|
||||
buildozer/PySolFC-Cardsets*
|
||||
buildozer/bin
|
||||
buildozer/tmp
|
||||
buildozer/support*
|
||||
buildozer/ENV
|
||||
buildozer/VENV
|
||||
venv*
|
||||
venv*
|
||||
|
|
|
@ -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
|
||||
|
||||
# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)
|
||||
orientation = all
|
||||
orientation = portrait, landscape
|
||||
|
||||
# (list) List of service to declare
|
||||
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY
|
||||
|
@ -96,6 +96,7 @@ fullscreen = 1
|
|||
|
||||
# (list) Permissions
|
||||
#android.permissions = INTERNET
|
||||
android.permissions = INTERNET, WRITE_EXTERNAL_STORAGE
|
||||
|
||||
# (list) features (adds uses-feature -tags to manifest)
|
||||
#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
|
||||
#p4a.commit = HEAD
|
||||
p4a.commit = v2023.02.10
|
||||
|
||||
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
|
||||
#p4a.source_dir =
|
||||
|
@ -388,7 +390,7 @@ ios.codesign.allowed = false
|
|||
[buildozer]
|
||||
|
||||
# (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)
|
||||
warn_on_root = 1
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
attrs
|
||||
buildozer
|
||||
configobj
|
||||
Cython
|
||||
Kivy
|
||||
pep8
|
||||
permutation
|
||||
pip
|
||||
pysol-cards
|
||||
python-for-android
|
||||
setuptools
|
||||
wheel
|
||||
appdirs==1.4.4
|
||||
attrs==22.2.0
|
||||
-e git+https://github.com/kivy/buildozer.git@3ebc09e885457db4747e67a1250c2aea1ca7a046#egg=buildozer
|
||||
colorama==0.4.6
|
||||
configobj==5.0.8
|
||||
Cython==0.29.33
|
||||
Jinja2==3.1.2
|
||||
Kivy==2.1.0
|
||||
pep517==0.13.0
|
||||
pep8==1.7.1
|
||||
permutation==0.4.0
|
||||
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')
|
||||
self.currentActivity = jnius.cast(
|
||||
'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):
|
||||
if jnius is None:
|
||||
|
@ -54,12 +57,19 @@ class AndroidPerms(object):
|
|||
|
||||
def getStoragePerm():
|
||||
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(
|
||||
["android.permission.WRITE_EXTERNAL_STORAGE"])
|
||||
|
||||
|
||||
def requestStoragePerm():
|
||||
ap = AndroidPerms()
|
||||
logging.info("androidperms: API version %d" % (ap.version.SDK_INT))
|
||||
if ap.version.SDK_INT > 29:
|
||||
return
|
||||
# ap.requestPerms(
|
||||
# ["android.permission.READ_EXTERNAL_STORAGE","android.permission.WRITE_EXTERNAL_STORAGE"])
|
||||
ap.requestPerms(
|
||||
|
|
|
@ -221,7 +221,7 @@ class PysolAboutDialog(object):
|
|||
logging.info('PysolAboutDialog: txt=%s' % text)
|
||||
|
||||
text = text + '\n\n' + 'Adaptation to Kivy/Android\n' + \
|
||||
' Copyright (C) (2016-19) LB'
|
||||
' Copyright (C) (2016-23) LB'
|
||||
|
||||
self.parent = parent
|
||||
self.app = app
|
||||
|
|
Loading…
Add table
Reference in a new issue