Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Plattformübergreifende Apps entwickeln mit Kivy und Python

Plattformübergreifende Apps entwickeln mit Kivy und Python

Vortrag bei mobile.cologne (Köln, 08.11.2012)
http://www.mobilecologne.de/2012-11-08-vortragsabend.html

Andreas Schreiber

November 08, 2012
Tweet

More Decks by Andreas Schreiber

Other Decks in Technology

Transcript

  1. Slide 2 www.medando.de mobile.cologne, Köln, 08.11.2012 Was bin ich? Wissenschaftler,

    Abteilungsleiter Gründer, Geschäftsführer Python-begeistert
  2. Slide 6 www.medando.de mobile.cologne, Köln, 08.11.2012 Python • Universelle dynamische

    Programmiersprache • Objektorientiert, Aspektorientiert, Funktional • Einfach zu lernen und klare, übersichtliche Syntax def fakultaet(x): if x > 1: return x * fakultaet(x - 1) else: return 1
  3. Slide 7 www.medando.de mobile.cologne, Köln, 08.11.2012 Kivy • Plattformübergreifendes Python-Framework

    • Läuft auf • Android • iOS • Windows • Linux • OSX • Basiert auf OpenGL ES 2.0 kivy.org
  4. Slide 8 www.medando.de mobile.cologne, Köln, 08.11.2012 Ziele von Kivy •

    Framework für Natural User Interfaces (NUI) • Touchscreens / Multi-Touch • Geeignet für heutige und zukünftige Geräte • Entwicklung in Python (für alle Plattformen) • Sowohl für Prototypen als auch Produkte geeignet
  5. Slide 9 www.medando.de mobile.cologne, Köln, 08.11.2012 Kivy Software • 5

    Hauptentwickler, >35 Contributors • Open Source (LGPL) • Source: https://github.com/kivy/kivy • Dokumentation: http://kivy.org/docs • Android: https://github.com/kivy/python-for-android • Google Play: https://play.google.com/store/apps/details?id=org.kivy.pygame • iOS: https://github.com/kivy/kivy-ios
  6. Slide 10 www.medando.de mobile.cologne, Köln, 08.11.2012 Kivy sagt Hallo! from

    kivy.app import App from kivy.uix.button import Button class TestApp(App): def build(self): return Button(text='Hello Cologne') TestApp().run()
  7. Slide 12 www.medando.de mobile.cologne, Köln, 08.11.2012 Entwicklung von Anwendungen •

    Python für Widgets, Input, Programmlogik • Sprache kv für Layout und Grafik • Cython für low-level-Zugriff auf Grafik-Routinen
  8. Slide 13 www.medando.de mobile.cologne, Köln, 08.11.2012 Einfaches Beispiel: Pong import

    kivy from kivy.app import App from kivy.uix.widget import Widget class PongGame(Widget): pass class PongApp(App): def build(self): return PongGame() if __name__ == '__main__': PongApp().run()
  9. Slide 14 www.medando.de mobile.cologne, Köln, 08.11.2012 Pong Grafik #:kivy 1.0.9

    <PongGame>: canvas: Rectangle: pos: self.center_x - 5, 0 size: 10, self.height Label: font_size: 70 center_x: root.width / 4 top: root.top - 50 text: "0" Label: font_size: 70 center_x: root.width * 3 / 4 top: root.top - 50 text: "0"
  10. Slide 16 www.medando.de mobile.cologne, Köln, 08.11.2012 Packaging • Erzeugen von

    Packages für Windows, OSX, Android und iOS: http://kivy.org/docs/guide/packaging.html
  11. Deutsches Zentrum für Luft- und Raumfahrt e.V. Anwendungsbeispiel: Pflanzenbeleuchtung mobile.cologne

    > Andreas Schreiber • Plattformübergreifende Apps entwickeln mit Kivy und Python > 08.11.2012 www.DLR.de • Folie 21
  12. Die Anwendung Pflanzenbeleuchtung - Webcam nimmt Bild auf - Rechner

    erkennt Pflanze - Rechner berechnet anhand von Einstellungen ein Ausgabebild - Lichtquelle (z.B. Beamer) beleuchtet die Pflanze mit dem Bild mobile.cologne > Andreas Schreiber • Plattformübergreifende Apps entwickeln mit Kivy und Python > 08.11.2012 www.DLR.de • Folie 22
  13. Slide 29 www.medando.de mobile.cologne, Köln, 08.11.2012 Fragen? @onyame Zusammenfassung •

    Kivy erlaubt plattformunabhängige Entwicklung mit Python für Android, iOS, Windows, OSX und Linux • Gut geeignet für Multitouch-Anwendungen