Konubinix' opinionated web of thoughts

Buildozer

Fleeting

make a poc app on android to ease trials and errors

buildozer init

Then, to install rpyc to interactively play with the phone

Note that in need the p4a.branch = release-2022.12.20 otherwise pyjnius fails to build.

[app]

# (str) Title of your application
title = PoC

# (str) Package name
package.name = PoC

# (str) Package domain (needed for android/ios packaging)
package.domain = org.test

# (str) Source code where the main.py live
source.dir = .

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas

# (list) Source files to exclude (let empty to not excluding anything)
#source.exclude_exts = spec

# (str) Application versioning (method 1)
version.regex = __version__ = '(.*)'
version.filename = %(source.dir)s/main.py

# (str) Application versioning (method 2)
# version = 1.2.0

# (list) Application requirements
# plumbum is needed by rpyc
requirements = kivy,android,pil,plumbum,rpyc,plyer

# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png

# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png

# (str) Supported orientation (one of landscape, portrait or all)
orientation = landscape

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0


#
# Android specific
#

# (list) Permissions
# (See https://python-for-android.readthedocs.io/en/latest/buildoptions/#build-options-1 for all the supported syntaxes and properties)
android.permissions = CAMERA,VIBRATE,INTERNET,READ_EXTERNAL_STORAGE,MANAGE_EXTERNAL_STORAGE
# uses-permission#android.permission.WRITE_EXTERNAL_STORAGE at AndroidManifest.xml:47:5-81 duplicated with element declared at AndroidManifest.xml:28:5-107

# (int) Android API to use
android.api = 31

# (int) Minimum API required (8 = Android 2.2 devices)
#android.minapi = 8

# (str) Android NDK version to use
#android.ndk = 8c
android.ndk = 25b

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =

# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path =

# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.renpy.android.PythonActivity

# (str) Semicolon separated list of Java .jar files to add to the libs so
# that pyjnius can access their classes. Don't add jars that you do not need,
# since extra jars can slow down the build process. Allows wildcards matching,
# for example: OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar;bar.jar;path/to/more/*.jar

# (str) python-for-android branch to use, if not master, useful to try
# not yet merged features.
#android.branch = master
p4a.branch = release-2022.12.20

# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME

# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png

# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =


#
# iOS specific
#

# (str) Name of the certificate to use for signing the debug version
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"

# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s


[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2
docker run -v $HOME/.buildozer:/home/user/.buildozer -v $(pwd):/home/user/hostcwd kivy/buildozer android debug



def rpyc():
    import os
    os.environ["NO_COLOR"] = "1"
    from rpyc.cli.rpyc_classic import ClassicServer
    ClassicServer.run(argv=["dummy", "--port=9999", "--host=0.0.0.0"])

Notes linking here