mirror of
https://github.com/liberatedsystems/openCom-Companion.git
synced 2024-11-25 23:00:36 +01:00
19 lines
511 B
Python
19 lines
511 B
Python
|
from os import environ
|
||
|
from jnius import autoclass
|
||
|
|
||
|
ANDROID_VERSION = autoclass('android.os.Build$VERSION')
|
||
|
SDK_INT = ANDROID_VERSION.SDK_INT
|
||
|
|
||
|
try:
|
||
|
from android import config
|
||
|
ns = config.JAVA_NAMESPACE
|
||
|
except (ImportError, AttributeError):
|
||
|
ns = 'org.renpy.android'
|
||
|
|
||
|
if 'PYTHON_SERVICE_ARGUMENT' in environ:
|
||
|
PythonService = autoclass(ns + '.PythonService')
|
||
|
activity = PythonService.mService
|
||
|
else:
|
||
|
PythonActivity = autoclass(ns + '.PythonActivity')
|
||
|
activity = PythonActivity.mActivity
|