A straight forward step by step guide in building Kivy application into android package (.apk file) using buildozer in Windows
- Open your browser and navigate to
Google Colab
- Create new notebook by clicking File > New Notebook
- Click the
+Code
in the upper part of the screen to add new cell - Add the following to a cell
-
The following cells are to install needed modules that will run the builder (
buildozer
,python
,git
).!sudo apt install git
!git clone https://github.com/kivy/buildozer.git
!sudo apt-get install python3
!sudo apt-get install python3-setuptools
cd buildozer
!sudo python3 setup.py install
cd ..
-
After installation of
buildozer, python and git
, you can now clone yourproject repository
that you want to build.
You can also upload your project to colab by zipping it and unzipping in the runtime storage if your project is not on github.!git clone github.com/username/repositorytitle
cd AppName
-
The
buildozer init
command will initialized a newbuildozer.spec
file. This file contains everything about the application you will build, such as app title, domain and package name.
Open the file to edit it based on the app requirements.!buildozer init
Sample values in the
buildozer.spec
filetitle = Race Game package.name = racegame package.domain = com.dev
-
Download
updates
andinstall
othermodules
needed for the build.!sudo apt update
!sudo apt install -y git zip openjdk-8-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev
!pip3 install --user --upgrade cython virtualenv
!sudo apt-get install cython
-
Build the application using the command:
!buildozer -v android debug
Run each cell. Make sure to don't skip any installation because it will be needed in the build.
With that, you will now be able to see the built .apk
file in the /bin
directory. Copy it to your phone and install. Make sure to allow sources in installing the .apk files.
You have successfully built your Kivy Application into Android!