Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Py on Android

1,885 views

Published on

Python on Android talk for django-cs group

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Py on Android

  1. 1. Python & Android @yedpodtrzitko
  2. 2. TL;DR
  3. 3. Dalvik apps Application frameworkDalvik VM Libs Linux kernel
  4. 4. Dalvik apps Application framework DalvikPython VM Libs(bin/lib) Linux kernel
  5. 5. Dalvik apps Application framework DalvikPython VM Libs(bin/lib) Linux kernel
  6. 6. Scripting Layer 4 Dalvik appsAndroid Application framework Dalvik Python VM Libs (bin/lib) Linux kernel
  7. 7. /sdcard/ import androidSL4A/app.py Scripting Dalvik apps droid = android.Android() Layer 4 Android name = droid. getInput("Hi!", "Ur name?") Application framework RPC res = name.result droid.makeToast("Hi, Dalvik %s"%res) Python VM Libs (bin/lib) Linux kernel
  8. 8. /sdcard/SL4A/app.py Scripting Dalvik apps Layer 4 Android Application framework RPC Dalvik Python VM Libs (bin/lib) Linux kernel
  9. 9. Scripting PySide Layer 4 Dalvik apps LauncherAndroid Application framework PySide DalvikPython VM Libs(bin/lib) QT Linux kernel
  10. 10. from PySide.QtCore import * /sdcard/from PySide.QtGui import * Scripting main.py Layer 4 Dalvik appsapp = QApplication() Android PySidew = QLabel(Foo bar) Launcherw.show()app.exec_() Application framework PySide Dalvik Python VM Libs (bin/lib) QT Linux kernel
  11. 11. /sdcard/Scripting main.py Layer 4 Dalvik appsAndroid PySide Launcher Application framework PySide DalvikPython VM Libs(bin/lib) QT Linux kernel
  12. 12. Scripting Kivy PySide Layer 4 Dalvik apps Launcher LauncherAndroid Application framework PySide DalvikPython VM Libs(bin/lib) QT Linux kernel
  13. 13. import android /sdcard/<app>/Scripting import kivy.uix.button as b main.py PySide Layer 4 from kivy.app import App Dalvik apps LauncherAndroid Kivy Launcher class TestApp(App): def build(self): return b.Button( Application frameworktext=foo bar) TestApp().run() PySide DalvikPython VM JNI(bin/lib) Libs QT Linux kernel
  14. 14. /sdcard/<app>/Scripting main.py PySide Layer 4 Dalvik apps LauncherAndroid Kivy Launcher Application framework PySide DalvikPython VM JNI(bin/lib) Libs QT Linux kernel
  15. 15. Framework Kivy, který vyrobili př i práci v ků lně a na podzimku žáci školy v Maleticích, je to nejmoderně jší, co pro Android máme. Co byste po mně chtě li!! 1
  16. 16. EOFSources:http://kivy.orghttp://thp.io/2011/pyside-android/https://code.google.com/p/android-scripting/ @yedpodtrzitko

×