55
loading...
This website collects cookies to deliver better user experience
In this article, I will explain how we can convert a cross-platform application made using kivy/kivymd in python on Windows to an APK file without the need for a Linux machine. For this, I will use the online platform called Google Colab.
!sudo apt update
!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-dev
!pip3 install --upgrade Cython==0.29.19 virtualenv
!export PATH=$PATH:~/.local/bin/
!pip install buildozer
!sudo apt-get install -y \
python3-pip \
build-essential \
git \
python3 \
python3-dev \
ffmpeg \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev \
libportmidi-dev \
libswscale-dev \
libavformat-dev \
libavcodec-dev \
zlib1g-dev
!sudo apt-get install -y \
python3-pip \
build-essential \
git \
python3 \
python3-dev \
ffmpeg \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev \
libportmidi-dev \
libswscale-dev \
libavformat-dev \
libavcodec-dev \
zlib1g-dev
!sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libncursesw5-dev libffi-dev uuid-dev libffi6
!sudo apt-get install libffi-dev
!buildozer init
title
, package.name
, package.domain
. source.dir
first, if your main.py
file is in the same directory, there is no need to change it, but if not, you should write the path
here. source.include_exts
.requirements
. If you only used kivy, python3,kivy==2.0.0rc4
will be enough to do it this way.If you also used kivymd then you should add this https://github.com/kivymd/KivyMD/archive/master.zip
. If you have used other libraries, run the pip install <library-name>
command, and it will show the downloaded packages. You can add them without specifying the version. icon.filename
and you can edit the path. fullscreen
1.!git clone <git-link-of-forked-repo>
p4a.source_dir = /path/to/your/python-for-android
and p4a.branch = develop
. !buildozer -v android debug