Writing /var/lib/dokuwiki/data/meta/teaching/ie0117/actividad_7new/kivy.meta failed
teaching:ie0117:actividad_7new:kivy
This is an old revision of the document!
Table of Contents
Actividad 7: Kivy
Preguntas
- Cómo se puede lograr que un mismo programa de python corra en Android y Linux?
- Qué es un Hardware Abstraction Layer (HAL)?
- Qué es un API (Application programming interface)?
- Qué es un widget?
- Qué es un evento?
Instrucciones
En la PC (Linux)
- En la PC instale python-kivy
- Clone el repositorio de git de plyer:
cd ~/local/src git clone https://github.com/kivy/plyer
- Construya un paquete de debian para plyer e instálelo
cd ~/local/src/plyer python setup.py --command-packages=stdeb.command bdist_deb cd deb_dist sudo dpkg -i python-plyer_1.2.5dev-1_all.deb
En Android
- Configure un servidor ssh. Instale la aplicación sshdroid (Play) o primitive ftpd (de f-droid), configure una clave para el servidor ssh
- Instale kivy-launcher con Play.
En la PC
- Monte el directorio remoto del celular en la computadora (si utiliza primitive ftpd):
mkdir -p ~/mnt/cel sshfs -p 1234 user@192.168.43.1:/ mnt/cel
- Ahora su celular está disponible en ~/mnt/cel
- Cambien al directorio de kivy en el celular desde su PC:
cd ~/mnt/cel/storage/emulated/0/kivy mkdir test cd test
- Dentro de este directorio cree un archivo llamado main.py con el siguiente contenido:
import kivy kivy.require('1.0.6') # replace with your current kivy version ! 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()
Evaluación
teaching/ie0117/actividad_7new/kivy.1463419548.txt.gz · Last modified: 2022/09/20 00:08 (external edit)