'how to use os.startfile() in Android environment?
I have an Android Python 3 kivy application and I'm trying to start the calendar from my app, but I don't know how to use os.startfile() in an Android environment. I know how to use in the Windows environment, but Android is different.
EDIT:
finally I found a way to make it work with Kivy and jnius to start any Android application from Python 3
just put the name of package at app_to_launch =
thanks to static_cast who point me the way
from jnius import cast
from jnius import autoclass
from kivy.context import get_current_context
app_to_launch = "org.package.name"
PythonActivity = autoclass('org.kivy.android.PythonActivity')
activity = cast('android.app.Activity', PythonActivity.mActivity)
pm = activity.getPackageManager()
app_intent = pm.getLaunchIntentForPackage(app_to_launch)
activity.startActivity(app_intent)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
