ANDROID SUPPORT
To borrow a couple of words from Wayne’s World, using the most excellent Buildozer tool, it is possible to create APK files that can be used on Android devices and uploaded to the Play Store. Open a terminal and run the following commands:
$ pip3 install --upgrade buildozer $ sudo apt update $ sudo apt install -y git zip unzip openjdk-17-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5dev libtinfo5 cmake libffi-dev libssl-dev $ pip3 install --upgrade Cython==0.29.33 $ buildozer init
With these commands, we have installed Buildozer and the necessary dependencies. When Buildozer runs, it helpfully installs any parts of the Android SDK that are required. Following the initialisation of the Buildozer project, you now need to edit the buildozer.spec file. Edit the title, package.name and package. domain to match the details of the application and who has created it (using the domain name in reverse format). Requirements should include plyer as well as python3 and kivy. The orientation line should all ow portrait and landscape, so that the application rerenders when the phone is turned around. The android.permissions line needs to contain android.permission. VIBRATE, otherwise the application crashes when the buttons are pressed. Finally, source.include_patterns should be set to images/*.png, so the images are included and the buttons render correctly.
Once the command has been entered and the run is completed, an APK file is generated within the bin folder. Buildozer also attempts to copy the APK to a connected phone, using the
USB debug capabilities.