archives:kivy_buildozer_pour_creer_une_application_android_avec_un_script_python
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_buildozer_pour_creer_une_application_android_avec_un_script_python [2018/11/28 05:55] – [Problème avec UTF-8 dans .kv] serge | archives:kivy_buildozer_pour_creer_une_application_android_avec_un_script_python [2019/12/26 09:38] (Version actuelle) – ↷ Page déplacée de archive:kivy_buildozer_pour_creer_une_application_android_avec_un_script_python à archives:kivy_buildozer_pour_creer_une_application_android_avec_un_script_python serge | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ======Kivy: Buildozer pour créer une application Android avec un script python====== | + | ======Archive: Buildozer pour créer une application Android avec un script python====== |
- | <WRAP center round box 60% centeralign> | + | |
+ | <WRAP center round box 50% centeralign> | ||
**{{tagpage> | **{{tagpage> | ||
</ | </ | ||
- | <WRAP center round info centeralign | + | <WRAP center round info centeralign |
- | **Cette page ne concerne que python | + | **Testé sur Debian Buster 10 Alpha 3 en Janvier 2019**\\ |
- | Pour python 2.7, voir la page **[[kivy_buildozer_avec_python_2.7|Buildozer avec python 2.7]]** | + | |
</ | </ | ||
- | Utiliser | + | ===== Ressources ===== |
- | Testé sur Debian Strech 9.2 en octobre 2017. | + | |
+ | | ||
- | ===== Installation de Kivy ===== | + | =====Tous les problèmes avec buildozer===== |
- | Voir [[Kivy Installation|Installation de Kivy et pyjnius]] | + | ==== Cython ==== |
+ | **Je ne comprends absolument pas pourquoi il faut cython en python3 | ||
- | ===== Buildozer | + | =====Contexte pour python 3===== |
- | ==== Installation ==== | + | * **https:// |
- | Dépendances suffisantes mais peut-être pas nécessaires: | + | |
- | Vérifier la version de cython à installer: | + | |
- | | + | |
- | < | + | ===== Compilation d'un projet ===== |
- | sudo apt-get install python3-dev zlib1g-dev pkg-config python3-colorama python3-sh python3-appdirs python3-jinja2 python3-six | + | |
- | </ | + | |
- | Cython version | + | |
- | < | + | |
- | sudo pip3 install --upgrade cython==0.25.2 | + | |
- | </ | + | |
- | Les lib32 pour un 64 bits | + | |
- | < | + | |
- | sudo dpkg --add-architecture i386 | + | |
- | sudo apt-get update | + | |
- | sudo apt-get install build-essential ccache git libncurses5: | + | |
- | </ | + | |
- | + | ==== Init ==== | |
- | [[https:// | + | |
- | < | + | |
- | git clone https:// | + | |
- | cd buildozer/ | + | |
- | python3 setup.py build | + | |
- | sudo pip3 install -e . | + | |
- | </ | + | |
- | + | ||
- | Version stable: | + | |
- | < | + | |
- | sudo pip3 install buildozer | + | |
- | </ | + | |
- | + | ||
- | === Ressources === | + | |
- | * [[https:// | + | |
- | * [[http:// | + | |
- | + | ||
- | ===== Compilation d'un projet | + | |
Ouvrir un terminal dans votre projet: | Ouvrir un terminal dans votre projet: | ||
- | ==== Init ==== | + | |
- | < | + | |
==== Edition de buildozer.spec ==== | ==== Edition de buildozer.spec ==== | ||
**Points importants** | **Points importants** | ||
Ligne 72: | Ligne 41: | ||
# (list) Application requirements | # (list) Application requirements | ||
# comma seperated e.g. requirements = sqlite3, | # comma seperated e.g. requirements = sqlite3, | ||
- | requirements = kivy | + | requirements = python3,kivy,openssl |
- | + | ||
- | # (str) Presplash of the application | + | |
- | presplash.filename = %(source.dir)s/ | + | |
- | + | ||
- | # (str) Icon of the application | + | |
- | icon.filename = %(source.dir)s/ | + | |
- | + | ||
- | # (str) Supported orientation (one of landscape, portrait or all) | + | |
- | orientation = landscape | + | |
# (list) Permissions | # (list) Permissions | ||
android.permissions = INTERNET, | android.permissions = INTERNET, | ||
+ | |||
+ | # SDK 20 / API 26 / NDK 15c / Python 3.7 | ||
+ | android.api = 26 | ||
+ | android.sdk = 20 | ||
+ | android.ndk = 15c | ||
+ | android.sdk_path = / | ||
+ | android.ndk_path = / | ||
# (str) The Android arch to build for, choices: armeabi-v7a, | # (str) The Android arch to build for, choices: armeabi-v7a, | ||
android.arch = armeabi-v7a | android.arch = armeabi-v7a | ||
</ | </ | ||
+ | |||
==== Version ==== | ==== Version ==== | ||
Il faut définir une version pour l' | Il faut définir une version pour l' | ||
Ligne 114: | Ligne 82: | ||
</ | </ | ||
- | ==== Exemple ==== | ||
- | * [[https:// | ||
- | ===== Compilation du apk ===== | + | ==== Compilation du apk ==== |
- | < | + | buildozer -v android debug |
- | + | ||
- | ===== .buildozer ===== | + | |
- | La compilation va créer un dossier .buildozer d'une taille en gros de 1 Go !! | + | |
===== Quand ça plante ===== | ===== Quand ça plante ===== | ||
* buildozer android clean | * buildozer android clean | ||
- | * Détruire /home/pierre/ | + | * Détruire /home/user/ |
* .buildozer du home | * .buildozer du home | ||
* .buildozer de votre dossier | * .buildozer de votre dossier | ||
* .android du home | * .android du home | ||
- | ===== Debug de l' | + | ===== Debug de l' |
- | Si l' | + | |
- | ==== Kivy Launcher ==== | ||
- | Cette méthode n' | ||
- | * [[https:// | ||
==== Suivre tout ce qui se passe sur le téléphone avec logcat ==== | ==== Suivre tout ce qui se passe sur le téléphone avec logcat ==== | ||
Ligne 148: | Ligne 107: | ||
- | ==== Problème avec UTF-8 dans .kv ==== | ||
- | * **A vérifier si c'est toujours actuel en 2019 avec python 3 par défaut !** | ||
- | |||
- | Dans truc.kv: | ||
- | <code python> | ||
- | Label: | ||
- | id: Titre | ||
- | font_size: | ||
- | text: self.titre.text | ||
- | </ | ||
- | Dans main.py: | ||
- | |||
- | <code python> | ||
- | class Machin(Screen): | ||
- | titre = ObjectProperty() | ||
- | |||
- | # Dans le __init__() ou ailleurs | ||
- | self.titre.text = " | ||
- | </ | ||
- | ===== Les packages python 3.5 impossibles ===== | ||
- | * twisted qui n'est pas officiellement porté en python 3 en novembre 2017 et n'est pas pris en charge par buildozer | ||
- | |||
- | ===== Un jeu qui marche ===== | ||
- | * **[[https:// | ||
- | =====Version en développement===== | ||
- | **Kivy buildozer python 3.5** mai 2018 | ||
- | sudo pip3 install Cython==0.27.3 | ||
- | git clone git:// | ||
- | cd kivy | ||
- | python3 setup.py build_ext --inplace -f | ||
- | sudo python3 setup.py install | ||
- | {{tag>kivy sb}} | + | {{tag>archive |
archives/kivy_buildozer_pour_creer_une_application_android_avec_un_script_python.txt · Dernière modification : 2019/12/26 09:38 de serge