How to develop and package an APP using Python

Note: The first use requires downloading some dependency packages, such as pip install cpython and installing Javac.

pip install kivy
pip install buildozer

If cpython is missing, execute the following code:

pip3 install --upgrade cython 

If an error message is missing Javac, install it as follows:

sudo apt install default-jdk            
sudo apt install openjdk-11-jdk-headless
sudo apt install ecj                    

The installation and packaging steps are shown in the following connections:

How to write a game in Python to run on an Android phone_Technical blog for mob64ca12ef9b85_51CTO Blog.

Attention: The spec file in the above connection is automatically generated. If you follow the instructions in the above connection, an error will be reported. The correct operation is as follows:

Run in the project directory:

buildozer init

A successful run will create a configuration file called buildozer.spec.

Then enter builder Android debug.

If prompted: Unable to download the Python for android file from GitHub, the solution is as follows:

Resolve the issue of downloading dependency packages for the builder runtime. Fatal: Unable to access' https://github.com/kivy/python-for-android.git "Solution Process - CSDN Blog.

Then follow the code in the connection to execute.