kivy相关链接

https://kivy.org/
https://cycleuser.gitbooks.io/kivy-guide-chinese/content/

编程环境

Anaconda

下载链接

https://docs.anaconda.com/free/anaconda/install/

建立工程文件夹

1
2
3
mkdir test
cd test
conda create -n kivy-study python=3.7

安装一些依赖

1
2
3
pip install kivy
pip install buildozer
pip install Cython

初始化文件夹

buildozer init
初始化生成配置文件buildozer.spec
2.png

打包apk

写一个 demo 文件

main.py
1
2
3
4
5
6
7
8
import kivy
from kivy.app import App
from kivy.uix.button import Button
class hellokivy(App) :
def build(self):
return Button(text="hellokivy")
if __name__=="__main__" :
hellokivy().run()

时间十分漫长,一言难尽
buildozer -v android debug
成功将会出现 # Android packaging done! # APK myapp-0.1-arm64-v8a_armeabi-v7a-debug.apk available in the bin directory

1.png