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 [2018/11/28 05:56] – [Version en développement] 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 60% 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 60%> +<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>
  
-Utiliser **VirtualBox avec 2 systèmes invités différents** si vous utilisez python3.5 et python2.7 pour divers projets. +===== Ressources ===== 
-Testé sur Debian Strech 9.en octobre 2017.+  [[https://github.com/kivy/buildozer|Buildozer sur GitHub]] 
 +  [[http://buildozer.readthedocs.io/en/latest/installation.html|Installation]]
  
-===== 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 et non pas cython3 !!!!!!!!!!!!!!!!!!**
  
-===== Buildozer ===== +=====Contexte pour python 3===== 
-==== Installation ==== +  * **https://github.com/kivy/kivy/wiki/Android-SDK-NDK-Information**
-Dépendances suffisantes mais peut-être pas nécessaires:+
  
-Vérifier la version de cython à installer: +  SDK 20 API 24 NDK 14b Python 3.7
-  [[https://kivy.org/docs/installation/installation-linux.html#cython|Version de cython]]+
  
-<code> +===== Compilation d'un projet =====
-sudo apt-get install python3-dev zlib1g-dev pkg-config python3-colorama python3-sh python3-appdirs python3-jinja2 python3-six +
-</code> +
-Cython version 0.28.2 en mai 2018 +
-<code> +
-sudo pip3 install --upgrade cython==0.25.2 +
-</code> +
-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 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 +
-</code>+
  
- +==== Init ====
-[[https://pypi.python.org/pypi/buildozer|Version en cours de développement]]: +
-<code> +
-git clone https://github.com/kivy/buildozer +
-cd buildozer/ +
-python3 setup.py build +
-sudo pip3 install -e . +
-</code> +
- +
-Version stable: +
-<code> +
-sudo pip3 install buildozer +
-</code> +
- +
-=== Ressources === +
-  * [[https://github.com/kivy/buildozer|Buildozer sur GitHub]] +
-  * [[http://buildozer.readthedocs.io/en/latest/installation.html|Installation]] +
- +
-===== Compilation d'un projet =====+
 Ouvrir un terminal dans votre projet: Ouvrir un terminal dans votre projet:
-==== Init ==== +  buildozer init
-<code>buildozer init</code>+
 ==== 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,kivy # comma seperated e.g. requirements = sqlite3,kivy
-requirements = kivy +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 landscapeportrait 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 114: 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 ==== 
-<code>buildozer -v android debug</code> +  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/.local/share/python-for-android+  * Détruire /home/user/.local/share/python-for-android
   * .buildozer du home   * .buildozer du home
   * .buildozer de votre dossier   * .buildozer de votre dossier
   * .android du home   * .android du home
  
-===== Debug de l'*.apk ===== +===== Debug de l'*.apk si l'application ne se lance pas =====
-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 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:  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> 
-===== 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://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.1543384574.txt.gz · Dernière modification : 2018/11/28 05:56 de serge