Class AndroidPlatform


  • public class AndroidPlatform
    extends Python.Platform
    Platform for Chaquopy on Android.
    • Constructor Detail

      • AndroidPlatform

        public AndroidPlatform​(@NotNull
                               Context context)
        Uses the Application context of the given context to initialize Python.
    • Method Detail

      • getApplication

        @NotNull
        public Application getApplication()
        Returns the Application context of the context which was passed to the contructor.
      • redirectStdioToLogcat

        public void redirectStdioToLogcat()

        Redirects the native stdout and stderr streams to Logcat. They will appear with the tags native.stdout and native.stderr respectively. This may be useful for debugging the Python startup process, or seeing messages produced by non-Python libraries.

        This method has no effect on stdin. It also has no effect on Python's sys.stdout and sys.stderr, which are always redirected as described here.

      • getPath

        @NotNull
        public String getPath()
        Description copied from class: Python.Platform
        Returns the value to assign to PYTHONPATH, or null to leave it unset. The default implementation returns null.
        Overrides:
        getPath in class Python.Platform
      • onStart

        public void onStart​(@NotNull
                            Python py)
        Description copied from class: Python.Platform
        Called after Python is started. The default implementation does nothing.
        Overrides:
        onStart in class Python.Platform