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édenteProchaine révisionLes deux révisions suivantes | ||
kivy_buildozer_pour_creer_une_application_android_avec_un_script_python [2018/12/29 16:45] – [Installation de python 3.7] serge | kivy_buildozer_pour_creer_une_application_android_avec_un_script_python [2019/01/23 12:11] – [Archive: Buildozer pour créer 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 80% 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é |
- | Pour python 2.7, voir la page **[[kivy_buildozer_avec_python_2.7|Buildozer avec python 2.7]]** | + | * **Debian Buster 10 Alpha 3**\\ |
+ | * **Xubuntu 18.04 dans VirtualBox** | ||
</ | </ | ||
- | <WRAP center round info centeralign 80%> | + | ===== Ressources ===== |
- | **En décembre 2018, buildozer | + | * [[https:// |
- | </WRAP> | + | * [[http:// |
- | <WRAP center round alert centeralign 80%> | + | =====Tous les problèmes avec buildozer===== |
- | **Bigre: Impossible de compiler un Hello World !** en décembre 2018, en python 3 ! | + | ==== Cython ==== |
- | </ | + | **Je ne comprends absolument pas pourquoi il faut cython en python3 et non pas cython3 !!!!!!!!!!!!!!!!!!** |
- | Utiliser | + | =====Contexte pour python 3===== |
+ | | ||
- | ===== Les dépendances en qq lignes provisoires ===== | + | * SDK 20 / API 24 / NDK 14b / Python 3.7 |
- | < | + | |
- | sudo dpkg --add-architecture i386 | + | |
- | sudo apt-get update | + | |
- | + | ||
- | # Logiciels | + | |
- | sudo apt-get install filezilla terminator caja-open-terminal grsync gparted geany geany-plugins ncdu git thunderbird blender inkscape vlc gimp audacity gdebi keepassxc geeqie blender simple-scan gnome-system-tools cups locales | + | |
- | + | ||
- | # System | + | |
- | sudo apt-get install python-pip python-freenect libsdl2-dev zlib1g-dev pkg-config autoconf automake cmake libav-tools dkms libtool libsdl2-2.0-0 ccache openjdk-8-jdk unzip ffmpeg libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev libgstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good libncurses5: | + | |
- | + | ||
- | # pip3 | + | |
- | sudo pip3 install jinja2 appdirs sh colorama setuptools | + | |
- | sudo pip3 install pyyaml bs4 unidecode lxml twisted numpy opencv-python kivy pygame cython buildozer pyjnius pygame kivy buildozer cython | + | |
- | sudo pip3 install --upgrade cython==0.29 | + | |
- | sudo pip3 install --upgrade pyjnius pygame kivy buildozer | + | |
- | sudo pip3 install https://github.com/ | + | |
- | + | ||
- | # pip | + | |
- | sudo pip install twisted numpy opencv-python pygame kivy colorama sh appdirs jinja2 six pyopenssl cython setuptools | + | |
- | sudo pip install buildozer | + | |
- | sudo pip install https:// | + | |
- | sudo pip install -U --force-reinstall Cython | + | |
- | + | ||
- | # locales | + | |
- | sudo dpkg-reconfigure locales | + | |
- | </ | + | |
- | + | ||
- | =====Installation de python 3.7===== | + | |
- | + | ||
- | sudo apt-get install build-essential checkinstall libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev | + | |
- | cd /usr/src | + | |
- | sudo wget https:// | + | |
- | sudo tar xzf Python-3.7.0.tgz | + | |
- | cd Python-3.7.0 | + | |
- | sudo ./configure --enable-optimizations | + | |
- | sudo make altinstall | + | |
- | python3 -V | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ===== Installation de Kivy ===== | + | |
- | Voir [[Kivy Installation|Installation de Kivy et pyjnius]] | + | |
- | + | ||
- | ===== Installation de Buildozer ===== | + | |
- | ==== Installation ==== | + | |
- | Dépendances suffisantes mais peut-être pas nécessaires: | + | |
- | + | ||
- | < | + | |
- | sudo apt-get install python3-dev zlib1g-dev pkg-config python3-colorama python3-sh python3-appdirs python3-jinja2 python3-six autoconf automake libtool build-essential cmake libav-tools dkms | + | |
- | </ | + | |
- | + | ||
- | ===Cython=== | + | |
- | + | ||
- | Vérifier la version de cython à installer: | + | |
- | * [[https:// | + | |
- | + | ||
- | **En décembre 2018, version = 0.29.1** | + | |
- | sudo pip3 install cython | + | |
- | Pour imposer une version: | + | |
- | sudo pip3 install --upgrade cython==0.23 | + | |
- | Mais quelle version est nécessaire ? | + | |
- | + | ||
- | ===Les lib32 pour un 64 bits=== | + | |
- | < | + | |
- | sudo dpkg --add-architecture i386 | + | |
- | sudo apt-get update | + | |
- | sudo apt-get install build-essential ccache git libncurses5: | + | |
- | </ | + | |
- | + | ||
- | ===En décembre 2018 sur debian stretch=== | + | |
- | + | ||
- | Version stable: | + | |
- | sudo pip3 install buildozer | + | |
- | retourne | + | |
- | Successfully installed buildozer-0.37 virtualenv-16.1.0 | + | |
- | + | ||
- | ===Doc github=== | + | |
- | < | + | |
- | # via pip (latest stable, recommended) | + | |
- | sudo pip install buildozer | + | |
- | + | ||
- | # latest dev version | + | |
- | sudo pip install https:// | + | |
- | # Successfully installed buildozer-0.38.dev0 | + | |
- | + | ||
- | # git clone, for working on buildozer | + | |
- | git clone https:// | + | |
- | cd buildozer | + | |
- | python setup.py build | + | |
- | sudo pip install -e . | + | |
- | </ | + | |
- | + | ||
- | === Ressources === | + | |
- | * [[https:// | + | |
- | * [[http:// | + | |
===== Compilation d'un projet ===== | ===== Compilation d'un projet ===== | ||
Ligne 137: | Ligne 44: | ||
# comma seperated e.g. requirements = sqlite3, | # comma seperated e.g. requirements = sqlite3, | ||
requirements = python3, | requirements = python3, | ||
- | |||
- | # (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 178: | Ligne 84: | ||
</ | </ | ||
- | ==== Exemple ==== | ||
- | * [[https:// | ||
==== Compilation du apk ==== | ==== Compilation du apk ==== | ||
Ligne 193: | Ligne 97: | ||
===== Debug de l' | ===== Debug de 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 207: | Ligne 108: | ||
- | |||
- | ==== 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 = " | ||
- | </ | ||
- | ===== Un jeu qui marche ===== | ||
- | * **[[https:// | ||
- | {{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