kivy_buildozer
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
kivy_2020_hello_world [2019/12/19 17:32] – [Instalation] serge | kivy_buildozer [2022/09/14 09:39] (Version actuelle) – [Venv] serge | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Kivy 2020: Buildozer pour compiler une application Android en python ====== | + | ====== Kivy: Buildozer pour compiler une application Android en python ====== |
<WRAP center round box 60% centeralign> | <WRAP center round box 60% centeralign> | ||
- | **... {{tagpage> | + | **{{tagpage> |
- | **... {{tagpage> | + | **[[http:// |
- | **...** | + | </ |
+ | <WRAP center round box 40% centeralign> | ||
+ | **[[les_pages_kivy_en_details|Les pages Kivy en détails]]** | ||
</ | </ | ||
- | |||
<WRAP center round box 60% centeralign> | <WRAP center round box 60% centeralign> | ||
- | **[[http:// | + | **Generic Python packager for Android and iOS** |
</ | </ | ||
- | =====Le programme python kivy===== | + | =====Ressources===== |
+ | * **[[https:// | ||
+ | * **[[https:// | ||
+ | |||
+ | |||
+ | =====Utilisation sur Debian 11 Bullseye===== | ||
+ | ====Dépendances==== | ||
+ | sudo apt install libsdl2-dev zlib1g-dev pkg-config autoconf automake cmake dkms libtool libsdl2-2.0-0 ccache unzip ffmpeg libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libswscale-dev libncurses5: | ||
+ | |||
+ | ===OpenJDK=== | ||
+ | Pour connaître votre version actuelle | ||
+ | java -version | ||
+ | |||
+ | Pour avoir la liste des versions installées | ||
+ | sudo update-java-alternatives --list | ||
+ | |||
+ | Pour changer de version | ||
+ | sudo update-alternatives --config java | ||
+ | |||
+ | Il faut la version 11 | ||
+ | sudo apt install openjdk-11-jdk openjdk-11-source | ||
+ | ====Venv==== | ||
+ | **C' | ||
+ | Dans le dossier du venv existant: | ||
+ | <code bash> | ||
+ | source mon_env/ | ||
+ | python3 -m pip install buildozer setuptools cython | ||
+ | buildozer init | ||
+ | |||
+ | File buildozer.spec created, ready to customize! | ||
+ | |||
+ | toto@debian:/ | ||
+ | (mon_env) toto@debian:/ | ||
+ | |||
+ | (mon_env) toto@debian:/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | =====Le programme python kivy Hello world===== | ||
* **[[https:// | * **[[https:// | ||
Ligne 35: | Ligne 74: | ||
La page plus ancienne **Kivy Comment créer une application android en python** est en [[archives/ | La page plus ancienne **Kivy Comment créer une application android en python** est en [[archives/ | ||
====Installation==== | ====Installation==== | ||
- | + | Des ressources suffisantes mais peut-être pas necéssaires ! | |
<code text> | <code text> | ||
Ligne 47: | Ligne 85: | ||
sudo pip3 install pygame kivy buildozer pyjnius | sudo pip3 install pygame kivy buildozer pyjnius | ||
</ | </ | ||
- | =====openjdk 11 vs 8===== | ||
- | Ce problème se retrouve identiquement sur une Xubuntu18.04 ! | + | =====Utilisation===== |
+ | Le fichier principal qui lance kivy doit s' | ||
+ | |||
+ | Dans le dossier du projet: | ||
+ | buildozer init | ||
+ | crée le fichier buildozer.spec | ||
+ | |||
+ | ====buildozer.spec==== | ||
+ | Il faut définir | ||
+ | |||
+ | ===Le buildozer.spec du hello world=== | ||
+ | <code python> | ||
+ | [app] | ||
+ | title = My Application | ||
+ | package.name = myapp | ||
+ | package.domain = org.test | ||
+ | source.dir = . | ||
+ | source.include_exts = py, | ||
+ | version = 0.14 | ||
+ | requirements = python3, | ||
+ | orientation = portrait | ||
+ | fullscreen = 0 | ||
+ | android.arch = armeabi-v7a | ||
+ | |||
+ | [buildozer] | ||
+ | log_level = 2 | ||
+ | warn_on_root = 1 | ||
+ | </ | ||
+ | |||
+ | === Version Méthode 1 === | ||
+ | Cette ligne doit être la première ligne de code du fichier main.py; les versions seront gérées dans ce fichier. | ||
+ | < | ||
+ | < | ||
+ | # (str) Application versioning (method 1) | ||
+ | version.regex = __version__ = ['" | ||
+ | version.filename = %(source.dir)s/ | ||
+ | |||
+ | # (str) Application versioning (method 2) | ||
+ | # version = 1.2.0 | ||
+ | </ | ||
+ | |||
+ | === Version Méthode 2 === | ||
+ | La version est définie dans ce fichier buildozer.spec: | ||
+ | < | ||
+ | # (str) Application versioning (method 1) | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # (str) Application versioning (method 2) | ||
+ | version = 1.2.0 | ||
+ | </ | ||
+ | |||
+ | ====Compilation==== | ||
+ | buildozer -v android debug | ||
+ | |||
+ | Le *.apk sera dans ./bin | ||
+ | |||
+ | =====openjdk 11 vs 8===== | ||
+ | ====L' | ||
+ | java.lang.NoClassDefFoundError: | ||
< | < | ||
Ligne 69: | Ligne 165: | ||
</ | </ | ||
- | * Aucunes des solutions proposées par **https:// | + | ====Issue 862==== |
+ | Aucunes des solutions proposées par **https:// | ||
- | ===Nous utiliserons la version 8: facile !=== | + | Les recherches avec ce message d' |
+ | |||
+ | ====Nous utiliserons la version 8: facile !==== | ||
Installation de openjdk8: https:// | Installation de openjdk8: https:// | ||
wget -qO - https:// | wget -qO - https:// | ||
Ligne 84: | Ligne 183: | ||
Victoire ! Une application qui marche ! | Victoire ! Une application qui marche ! | ||
- | La compilation est longue, quelques heures, quelques Go téléchargés. Une recompilation suite à une nouvelle version serait bien sûr rapide. | + | La compilation est longue, quelques heures, quelques Go téléchargés. Une recompilation suite à une nouvelle version serait bien sûr rapide |
- | 13 Mo pour une application qui ne fais rien: **{{ :: | + | 13 Mo pour une application qui ne fait rien: **{{ media_09: |
Lorsque la compilation fini sur une erreur, je fais table rase: suppression des .android, .buildozer du home et du dossier du projet. | Lorsque la compilation fini sur une erreur, je fais table rase: suppression des .android, .buildozer du home et du dossier du projet. | ||
- | {{tag>kivy_2020 kivy python3 | + | ====Deboggage sur Android==== |
+ | * [[https:// | ||
+ | < | ||
+ | sudo apt-get install adb | ||
+ | adb root | ||
+ | adb shell | ||
+ | kminilte:/ | ||
+ | </ | ||
+ | |||
+ | {{tag> buildozer |
kivy_buildozer.1576776757.txt.gz · Dernière modification : 2019/12/19 17:32 de serge