GUI Using Python With Kivy, Deploy It to APK, From Any Operating System Without Virtualbox š
Make an android app with kivy or kivymd, which also support Windows, Mac, Linux, and Raspberry pi also.
Step 1.
Ubuntu 18.04 user can skip this step.
Other operating system install Ubuntu 18.04 in docker, as shown bellow. Remember if you install Ubuntu in this process you donāt have to waste very much ram like virtual box.
Step 2 : Install Kivy
In ubuntu Kivy is built from the packages python-kivy
, python-kivy-examples
.
So install these packages by run ..
sudo apt-get install python-kivy python-kivy-examples debhelper python python-all-dev cython libgl1-mesa-dev libgles2-mesa-dev
Buildozer
Buildozer is a tool that aim to package mobiles application easily. It automates the entire build process, download the prerequisites like python-for-android, Android SDK, NDK, etc.
How to install ?
First of all download buildozer.
apt install git # if git is not installed already
git clone https://github.com/kivy/buildozer.git
Install Python
sudo apt install python3.6
Install Setup tools
sudo apt-get install python3-setuptools
Go to buildozer directory
cd buildozer
Install setup.py
by this command
sudo python3 setup.py install
Install some packages
sudo apt install -y git zip unzip openjdk-8-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-devpip3 install --user --upgrade Cython==0.29.19 virtualenvexport PATH=$PATH:~/.local/bin/
Install Cython
sudo apt-get install cython
Convert Your App to APK
Move to the directory where your kivy project present
Initialize Buildozer
buildozer init
Write nano buildozer.spec
Do some changes
#(str) Title of your application
title = My Application (name of your applications)#(str) Package name
package.name = myapp (package name)
And also change this
#(str) Android logcat filters to use
#android.logcat_filters = *:S python:D
to
#(str) Android logcat filters to use
android.logcat_filters = *:S python:D
run the last command
buildozer android debug deploy run