The code to open a browser on Android would be something like this:
from android content import Intent
from android.net import Uri
intent = Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"))
context.startActivity(intent)
However, Android doesn't provide any public way to get a context unless you already have a reference to a UI object. Within Chaquopy, we already have a reference to the global Application context. But in order to upstream this to CPython, we'd need to get the context in JNI using something like this:
Although ActivityThread is a hidden class, the relevant methods are all marked with @UnsupportedAppUsage, which means Google is aware that applications are using them, so they haven't blocked them.
The code to open a browser on Android would be something like this:
However, Android doesn't provide any public way to get a context unless you already have a reference to a UI object. Within Chaquopy, we already have a reference to the global Application context. But in order to upstream this to CPython, we'd need to get the context in JNI using something like this:
Although ActivityThread is a hidden class, the relevant methods are all marked with
@UnsupportedAppUsage
, which means Google is aware that applications are using them, so they haven't blocked them.