Outils pour utilisateurs

Outils du site


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.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
kivy_buildozer_pour_creer_une_application_android_avec_un_script_python [2019/01/02 15:48] – [Installation de python 3.7] sergearchives: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 80% centeralign>+ 
 +<WRAP center round box 50% centeralign>
 **{{tagpage>kivy|Toutes les pages Kivy}}** **{{tagpage>kivy|Toutes les pages Kivy}}**
 </WRAP> </WRAP>
  
-<WRAP center round info centeralign 80%> +<WRAP center round info centeralign 50%> 
-**Cette page ne concerne que python 3.5** +**Testé sur Debian Buster 10 Alpha en Janvier 2019**\\ 
-Pour python 2.7, voir la page **[[kivy_buildozer_avec_python_2.7|Buildozer avec python 2.7]]**+
 </WRAP> </WRAP>
  
-<WRAP center round info centeralign 80%> +===== Ressources ===== 
-**En décembre 2018, buildozer compile officiellement avec python 3, ne plus utiliser Crystax** +  [[https://github.com/kivy/buildozer|Buildozer sur GitHub]] 
-</WRAP>+  * [[http://buildozer.readthedocs.io/en/latest/installation.html|Installation]]
  
-<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.5 sur debian stretch ! +==== Cython ==== 
-</WRAP>+**Je ne comprends absolument pas pourquoi il faut cython en python3 et non pas cython3 !!!!!!!!!!!!!!!!!!**
  
-Utiliser **VirtualBox avec 2 systèmes invités différents** si vous utilisez python3.5 et python2.7 pour divers projets.+=====Contexte pour python 3===== 
 +  * **https://github.com/kivy/kivy/wiki/Android-SDK-NDK-Information**
  
-===== Les dépendances en qq lignes provisoires ===== +  * SDK 20 API 24 NDK 14b / Python 3.7
-<code> +
-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:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev zlib1g:i386 openjdk-8-source libssl-dev openssl gcc libpangoxft-1.0-0:i386 adb libtool build-essential python-dev python3-pip python3-dev python3-six python-six libpython3-all-dev python3-all python3-all-dev python3-virtualenv virtualenv +
- +
-# 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/kivy/buildozer/archive/master.zip +
- +
-# 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://github.com/kivy/buildozer/archive/master.zip +
-sudo pip install -U --force-reinstall Cython +
- +
-# locales +
-sudo dpkg-reconfigure locales +
-</code> +
- +
-=====Installation de python 3.7 sur debian stretch===== +
-!!!!!!!!!!!!!!!! Ne surtout pas faire ça, ça va casser tous les programmes construit en python !!!!!!!!!!!!!!!!!!!! +
- +
-  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://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz +
-  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: +
- +
-<code> +
-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 +
-</code> +
- +
-===Cython===  +
- +
-Vérifier la version de cython à installer: +
-  * [[https://kivy.org/docs/installation/installation-linux.html#cython|Version de cython]] +
- +
-**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=== +
-<code> +
-sudo dpkg --add-architecture i386 +
-sudo apt-get update +
-sudo apt-get install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 +
-</code> +
- +
-===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=== +
-<code> +
-# via pip (latest stable, recommended) +
-sudo pip install buildozer +
- +
-# latest dev version +
-sudo pip install https://github.com/kivy/buildozer/archive/master.zip +
-# Successfully installed buildozer-0.38.dev0 +
- +
-# git clone, for working on buildozer +
-git clone https://github.com/kivy/buildozer +
-cd buildozer +
-python setup.py build +
-sudo pip install -e . +
-</code> +
- +
-=== Ressources === +
-  * [[https://github.com/kivy/buildozer|Buildozer sur GitHub]] +
-  * [[http://buildozer.readthedocs.io/en/latest/installation.html|Installation]]+
  
 ===== Compilation d'un projet ===== ===== Compilation d'un projet =====
Ligne 138: Ligne 42:
 # comma seperated e.g. requirements = sqlite3,kivy # comma seperated e.g. requirements = sqlite3,kivy
 requirements = python3,kivy,openssl requirements = python3,kivy,openssl
- 
-# (str) Presplash of the application 
-presplash.filename = %(source.dir)s/data/logo_labomedia.png 
- 
-# (str) Icon of the application 
-icon.filename = %(source.dir)s/data/multipong.png 
- 
-# (str) Supported orientation (one of landscape, portrait or all) 
-orientation = landscape 
  
 # (list) Permissions # (list) Permissions
 android.permissions = INTERNET,CHANGE_WIFI_MULTICAST_STATE,ACCESS_NETWORK_STATE,ACCESS_WIFI_STATE android.permissions = INTERNET,CHANGE_WIFI_MULTICAST_STATE,ACCESS_NETWORK_STATE,ACCESS_WIFI_STATE
 +
 +# SDK 20 / API 26 / NDK 15c / Python 3.7
 +android.api = 26
 +android.sdk = 20
 +android.ndk = 15c
 +android.sdk_path = /media/data/src_android/android-sdk-20
 +android.ndk_path = /media/data/src_android/android-ndk-r15c
  
 # (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86 # (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
 android.arch = armeabi-v7a android.arch = armeabi-v7a
 </code> </code>
 +
 ==== Version ==== ==== Version ====
 Il faut définir une version pour l'application que vous compilez. Il faut définir une version pour l'application que vous compilez.
Ligne 179: Ligne 82:
 </code> </code>
  
-==== Exemple ==== 
-  * [[https://github.com/sergeLabo/TapOSC/blob/master/buildozer.spec|Un buildozer.spec de TapOSC sur GitHub]] 
  
 ==== Compilation du apk ==== ==== Compilation du apk ====
Ligne 194: Ligne 95:
 ===== Debug de l'*.apk si l'application ne se lance pas ===== ===== Debug de l'*.apk si l'application ne se lance pas =====
  
-==== Kivy Launcher ==== 
-Cette méthode n'exécute pas le apk, mais lance le main.py. Utilisez logcat. 
-  * [[https://play.google.com/store/apps/details?id=org.kivy.pygame&hl=en|Méthode insuffisante]] 
  
 ==== 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 208: Ligne 106:
  
  
- 
-==== 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:  root.width/28 
-        text: self.titre.text 
-</code> 
-Dans main.py: 
- 
-<code python> 
-class Machin(Screen): 
-    titre = ObjectProperty() 
- 
-    # Dans le __init__() ou ailleurs 
-    self.titre.text = "éèàùê" 
-</code> 
  
  
-===== Un jeu qui marche ===== 
-  * **[[https://wiki.labomedia.org/index.php/Multi_Pong|Multi Pong]]** 
  
  
-{{tag>kivy sb}}+{{tag>archive sb}}
archives/kivy_buildozer_pour_creer_une_application_android_avec_un_script_python.1546444094.txt.gz · Dernière modification : 2019/01/02 15:48 de serge