Outils pour utilisateurs

Outils du site


archives:kivy_comment_creer_une_application_android_en_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_comment_creer_une_application_android_en_python [2019/01/05 11:05] – [Kivy Comment creer une application android en python] sergearchives:kivy_comment_creer_une_application_android_en_python [2020/04/03 17:59] (Version actuelle) serge
Ligne 1: Ligne 1:
-======Kivy Comment creer une application android en python======+======Archives : Kivy Comment créer une application android en python======
  
-Buildozer ne marche plus du tout: j'ai passé beaucoup de temps à essayer de compiler un hello World en python 2 ou 3 !+<WRAP center round alert 60%> 
 +**Cette page est obsolète, elle est en archives !**
  
-Et essayé un tas de trucs en 2018 sans succès !+Voir **[[::kivy_buildozer|Kivy: Buildozer pour compiler une application Android en python]]** pour la dernière version 
 +</WRAP>
  
-**Qu'en disent les internets ?**+<WRAP center round box 60% centeralign> 
 +**{{tagpage>kivy|Toutes les pages Kivy}}** 
 +</WRAP> 
 + 
 +<WRAP center round important 60% centeralign> 
 +**Buildozer compile le Python 3 par défaut !**\\  
 +**Mais je n'ai pas réussi à obtenir un *.apk** 
 +Et ça ne marche pas non plus en python 2 ! 
 +</WRAP> 
 + 
 +<WRAP center round info 60% centeralign> 
 +Testé en janvier 2019 sur:\\ 
 +**Debian Buster alpha 4**\\ 
 +et sur \\ 
 +**Xubuntu 18.04 dans VirtualBox** 
 +</WRAP> 
 + 
 +=====Buildozer et python 3===== 
 +**[[https://github.com/kivy/buildozer|Buildozer]]** Generic Python packager for Android and iOS 
 + 
 +Buildozer est un des projets de kivy. **Quand ça marche**, c'est super pratique. Cela permet de créer une application Andoid à partir de script python utilisant **[[https://kivy.org/#home|Kivy]]**. 
 + 
 +Last but not least, un tas de package python ne sont pas supportés. 
 + 
 +  * [[https://github.com/kivy/buildozer|Buildozer sur GitHub]] 
 +  * [[http://buildozer.readthedocs.io/en/latest/installation.html|Installation]] 
 +  * [[https://kivy.org/docs/guide/packaging-android.html|Guide Android]] 
 + 
 +=====Les problèmes avec buildozer en décembre 2018=====
   * [[https://stackoverflow.com/questions/53613329/buildozer-gives-error-upon-building-pong-app-of-kivy-framework-for-android-publi|Buildozer gives error upon building pong app]] **Je ne suis pas le seul !**   * [[https://stackoverflow.com/questions/53613329/buildozer-gives-error-upon-building-pong-app-of-kivy-framework-for-android-publi|Buildozer gives error upon building pong app]] **Je ne suis pas le seul !**
   * [[https://stackoverflow.com/questions/43477095/buildozer-on-kivy-example-fails-to-build-apk/53849129#53849129|Buildozer on kivy example fails to build apk]] **Buildozer semble n'être qu'une perte de temps !**   * [[https://stackoverflow.com/questions/43477095/buildozer-on-kivy-example-fails-to-build-apk/53849129#53849129|Buildozer on kivy example fails to build apk]] **Buildozer semble n'être qu'une perte de temps !**
   * [[https://stackoverflow.com/questions/43477095/buildozer-on-kivy-example-fails-to-build-apk/53849129#53849129|Essayer Python for Android or QPython]] **BuilDozer est obsolète !**   * [[https://stackoverflow.com/questions/43477095/buildozer-on-kivy-example-fails-to-build-apk/53849129#53849129|Essayer Python for Android or QPython]] **BuilDozer est obsolète !**
-  * [[https://stackoverflow.com/questions/54039201/i-can-not-by-buildozer-create-apk|I cann't create apk with buildozer]] **L'auteur dit avoir essayé différentes méthodes mais que tout se fini sur une erreur: comme moi !** S'il vous plaît, publier une vrai documentation en 2019. +  * [[https://stackoverflow.com/questions/54039201/i-can-not-by-buildozer-create-apk|I cann't create apk with buildozer]] **L'auteur dit avoir essayé différentes méthodes mais que tout se fini sur une erreur: comme moi !** 
-  * [[https://github.com/kivy/buildozer/issues/774|Buildozer issue 774]]**La documentation est très imprécise** +  * [[https://github.com/kivy/buildozer/issues/774|Buildozer issue 774]] **La documentation est très imprécise** 
-===== Python-for-Android ===== +  * [[https://www.reddit.com/r/Python/comments/9fqh7y/my_experience_with_kivy_so_far_2_weeks_in/|Vu de loin sur reddit.com]] **Mais ce ne sera pas sans peine** 
-  * **[[https://github.com/kivy/python-for-android|python-for-android sur github]]** + 
-====Sur Github dans le projet Kivy==== +====Quel Cython ?==== 
-Python-for-Android est un emballeur pour les applications Python sur AndroidVous pouvez créer votre propre distribution Pythony compris les modules et dépendances de votre choixet la regrouper dans un APK avec votre propre code.+**[[https://kivy.org/docs/installation/installation-linux.html#cython|Version de cython]]** 
 + 
 +   * cython ou cython3 et quelle version ? 
 +   * buildozer avec pip ou pip3 et quelle version ? 
 + 
 +====Quelle version de SDK, NDK et ANDROID API ?==== 
 +  * **[[https://github.com/kivy/kivy/wiki/Android-SDK-NDK-Information|Android SDK NDK API Information]]** dans le wiki Kivy. 
 + 
 +=====Hello World sur debian buster avec python 3.7 dans une VirtualBox===== 
 +====Installation des dépendances==== 
 +<code> 
 +sudo apt-get install caja-open-terminal geany geany-plugins git gnome-system-tools locales 
 + 
 +sudo dpkg --add-architecture i386 
 +sudo apt-get update 
 + 
 +sudo apt-get install libsdl2-dev zlib1g-dev pkg-config autoconf automake cmake dkms libtool libsdl2-2.0-0 ccache openjdk-11-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 zlib1g:i386 openjdk-11-source libssl-dev openssl gcc libpangoxft-1.0-0:i386 adb libtool build-essential python3-pip python3-dev python3-six libpython3-all-dev python3-all python3-all-dev python3-virtualenv virtualenv 
 + 
 +sudo pip3 install jinja2 appdirs sh colorama setuptools cython 
 +sudo pip3 install pygame kivy buildozer pyjnius 
 +</code> 
 + 
 +====Version==== 
 +  * cython    0.29.2 
 +  * kivy      1.10.1 
 +  * buildozer 0.35 
 +  * pygame-1.9.4 
 +====Fichiers==== 
 +<file python main.py> 
 +#! /usr/bin/env python3 
 +# -*- coding: utf-8 -*- 
 + 
 +import kivy 
 +kivy.require('1.10.1'
 + 
 +from kivy.app import App 
 +from kivy.uix.label import Label 
 + 
 +class MyApp(App): 
 +    def build(self): 
 +        return Label(text='Hello world'
 + 
 +if __name__ == '__main__': 
 +    MyApp().run() 
 +</file> 
 + 
 +<file python buildozer.spec> 
 +[app] 
 +title = My Application 
 +package.name = myapp 
 +package.domain = org.test 
 +source.dir = . 
 +build_dir = /build/myapp 
 +source.include_exts = py,png,jpg,kv,atlas 
 +version = 3.00 
 +requirements = python3,kivy 
 +orientation = portrait 
 +fullscreen = 0 
 +android.arch = armeabi-v7a 
 + 
 +android.api = 24 
 +android.sdk = 20 
 +android.ndk = 14b 
 +android.ndk_path = /media/sf_data/src_android/android-ndk-r14b 
 +android.sdk_path = /media/sf_data/src_android/android-sdk-20
  
-Les fonctionnalités incluent: +[buildozer] 
-  * Prise en charge de la construction avec Python et Python 3. +log_level = 
-  * Différents moteurs d'applications, notamment Kivy, PySDL2 et un serveur Web View avec Python. +warn_on_root = 1 
-  * Prise en charge automatique de la plupart des modules Python purs et prise en charge intégrée de nombreux autres, notamment les dépendances courantes telles que numpy et sqlalchemy. +</file>
-  * Cibles d'architecture multiples, pour les APK optimisés sur n'importe quel appareil.+
  
-Pour la documentation et le support, voir: +=====Hello World sur Xubuntu 18.04  avec python 3.6.7 dans une VirtualBox===== 
-  * Site Web: http://python-for-android.readthedocs.io +** Problèmece n'est pas python3.!!!**
-  Liste de diffusionhttps://groups.google.com/forum/#!forum/kivy-users ou https://groups.google.com/forum/#!forum/python-android.+
  
-En 2015, ces outils ont été réécrits pour fournir une nouvelle interface, plus facile à utiliser et à étendre. Si vous recherchez l’ancienne chaîne d’outils avec distributions.sh et build.py, elle est toujours disponible à l’adresse https://github.com/kivy/python-for-android/tree/old_toolchain, ainsi que les numéros et les relations publiques en relation avec cette branchesont toujours acceptés. Cependant, la nouvelle chaîne d’outils contient les mêmes fonctionnalités via le bootstrap intégré de pygame.+====Installation de buildozer à partir de la branche master sur github==== 
 +  sudo pip3 install https://github.com/kivy/buildozer/archive/master.zip 
 +installe buildozer 0.38 dev0
  
-=====Premiers tests===== +  sudo pip3 install git+https://github.com/kivy/kivy.git@master 
-==== Hello World ====+Successfully installed Kivy-1.11.0.dev0
  
-====WIKIKIRC en python 3==== 
-  * https://github.com/kivy/python-for-android/issues/1564 pour valider openssl en python3 
  
 +===== Kivy Virtual Machine (for Android/buildozer) sur Xubuntu 17.04  =====
 +  * Voir ** [[https://kivy.org/#download|Kivy Virtual Machine (for Android/buildozer)]]** **juste pour essayer**, la VM est basée sur **Xubuntu 17.04 qu'il n'est plus possible de mettre à jour.**
  
 +===== Des applications réussies jusqu'en avril 2018=====
 +  * **[[https://wiki.labomedia.org/index.php/Multi_Pong|Multi Pong]]**
 +  * **[[:taposc|Kivy: TapOSC]]**
 +  * **[[https://github.com/sergeLabo/wikikircandroid2|]]**
 +  * **[[https://github.com/sergeLabo/atts|Android Threaded TCP Server made with kivy buildozer python3]]**
 +  * **[[https://github.com/sergeLabo/TCPclient|Un client TCP simple pour test]]**
 +  * **[[https://github.com/sergeLabo/androidserver2|Python server on android, on local network. Used in a futur funny game.]]**
 +  * **[[https://github.com/sergeLabo/kivent_example_16|Test with kivent example 16 avec kivent]]**
 +  * **[[https://github.com/sergeLabo/Buggy/tree/master/android_wheel|Un téléphone comme volant]]**
  
-=====Solutions propriétaires===== +{{tag>archive sb}}
-  * [[http://qpy.io/price/|QPython]] et sur [[https://github.com/qpython-android|github.com]]+
archives/kivy_comment_creer_une_application_android_en_python.1546686337.txt.gz · Dernière modification : 2019/01/05 11:05 de serge