SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
www.DLR.de • Chart 1   > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Developing Apps for Android
and Other Platforms with Kivy
and Python


Andreas Schreiber <andreas.schreiber@dlr.de>

droidcon 2013, Berlin, 09. April 2013
www.DLR.de • Chart 2   > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Outline

• Introduction
• Python
• Kivy
• Demos
• Limitations
• Credits
www.DLR.de • Chart 3   > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Me

 Scientist,
 Head of department



 Founder,
 CEO




 Enthusiastic about
 Python
www.DLR.de • Chart 4   > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




DLR
German Aerospace Center




− Research Institution
− Space Agency
− Project Management Agency
www.DLR.de • Chart 5   > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Locations and employees

7400 employees across                                                                             Stade  Hamburg
32 institutes and facilities at                                                                                                          Neustrelitz
                                                                                         Bremen                   Trauen
     16 sites.
                                                                                                                                  Berlin 
                                                                                            Braunschweig 
Offices in Brussels, Paris,
                                                                                                                 Goettingen
Tokyo and Washington.
                                                                       Juelich   Cologne
                                                                                  Bonn
~1400 employees develop software

                                                                              Lampoldshausen 

                                                                                         Stuttgart 
                                                                                                  Augsburg 
                                                                                                                           Oberpfaffenhofen
                                                                                                         Weilheim 
www.DLR.de • Chart 6   > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Python
Python

• General-purpose, high-level programming language
• Object-oriented, aspect-oriented, functional
• Dynamic type system
• Easy-to-learn with clear and expressive syntax




        def faculty(x):
            if x > 1:
                return x * faculty(x - 1)
            else:
                return 1
www.DLR.de • Chart 8   > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Python on Mobile Devices

Early Mobile Development with Python
• PyS60 for Symbian
• Python CE for Windows Mobile


Current Mobile Development with Python
• Scripting Layer for Android (SL4A)
• Python for Android (Py4A)
• PySide / Qt for Android
• WinRT / IronPython for Windows 8
• Kivy…
www.DLR.de • Chart 9   > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Kivy
www.DLR.de • Chart 10 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Kivy

• Platform-independent Python-Framework


• Available for
    • Android
    • iOS
    • Meego
    • Windows                                                                                                  kivy.org
    • Linux
    • OSX
    • (Raspberry Pi)

• Development in Python on all platforms
    • Not emulated!
www.DLR.de • Chart 11 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Kivy Basics

• Framework for Natural User Interfaces (NUI)
    • Touchscreens / Multi-Touch

• GPU accelerated graphics
    • Based on OpenGL ES 2.0

• Suitable for prototypes as well as products
    • Porting to new platforms is easy
www.DLR.de • Chart 12 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Kivy Software

• Open Source (LGPL), 7 Core developer


• Source code: https://github.com/kivy


• Documentation: http://kivy.org/docs


• Kivy on Google Play:
   https://play.google.com/store/apps/details?id=org.kivy.pygame
www.DLR.de • Chart 13 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Kivy says Hello!


   from kivy.app import App
   from kivy.uix.button import Button

   class HelloApp(App):
       def build(self):
           return Button(text='Hello Berlin')

   HelloApp().run()
www.DLR.de • Chart 14 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013
www.DLR.de • Chart 15 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Development with Kivy

• Python for widgets, input, program logic


• Language KV for layout und graphics


• Cython for low-level access to graphic routines
www.DLR.de • Chart 16 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




“Hello Berlin” with KV


   from kivy.app import App

   class HelloApp(App):
       pass

   HelloApp().run()                                                                                   File hello.kv
                                                                                                      defines root widget

                                                                            #:kivy 1.0

                                                                            Button:
                                                                                text: ‘Hello Berlin’
www.DLR.de • Chart 17 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Example: 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()
www.DLR.de • Chart 18 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Pong Graphics
                       #:kivy 1.6.0

                       <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"
www.DLR.de • Chart 19 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Pong




Full example: http://kivy.org/docs/tutorials/pong.html
www.DLR.de • Chart 20 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Accessing Java Classes from Python

• Smartphones have many APIs
    • Camera, Compass, Contacts, Location, …

• Access from Python via PyJNIus
    • https://github.com/kivy/pyjnius
    • Implemented with JNI and Java reflection

Example

  from jnius import autoclass

  Hardware = autoclass('org.renpy.android.Hardware')
  print 'DPI is', Hardware.getDPI()
www.DLR.de • Chart 21 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Packaging

• Creating packages for Windows, OSX, Android und iOS:
    http://kivy.org/docs/guide/packaging.html
www.DLR.de • Chart 22 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Build Tools

Tool chain
• Python-for-android
• Cross compiler for ARM
• Android SDK & NDK
• Python and some Python packages


Buildozer
• Hides the complexity: Downloads, compiles, packages Kivy source code
• https://github.com/kivy/buildozer

  % buildozer android debug deploy run
www.DLR.de • Chart 23 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Demos
www.DLR.de • Chart 24 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Kivy Showcase
www.DLR.de • Chart 25 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Kivy Pictures
www.DLR.de • Chart 26 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Small Dragon Luki
Speech therapy game for kids
www.DLR.de • Chart 27 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Small Dragon Luki
www.DLR.de • Chart 28 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




MQTT Client
www.DLR.de • Folie 29   mobile.cologne > Andreas Schreiber • Plattformübergreifende Apps entwickeln mit Kivy und Python > 08.11.2012




Steering Plant Growth

• Webcam takes picture of plants


• Computer detects plant


• Computer generates an image for
  lighting


• Light source (e.g., a projector)
  illuminates the plant using the
  generated image
www.DLR.de • Chart 30 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013
www.DLR.de • Chart 31 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013
www.DLR.de • Chart 32 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013
www.DLR.de • Chart 33 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013
www.DLR.de • Chart 34 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Other Examples…
iOS-App Deflectouch

https://itunes.apple.com/de/app/deflectouch/id505729681
iOS/Android-App ProcessCraft

https://itunes.apple.com/gb/app/processcraft/id526377075
http://showgen.com
www.DLR.de • Chart 37 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Limitations
www.DLR.de • Chart 38 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Missing, but Planned (or In Progress)

User Interface Designer
• Design tool for Kivy Language KV
• Planned for GSoC


Abstraction of mobile APIs
• Platform-independent Python wrapper for platform APIs (Android, iOS,
  Linux/Mac/Windows)
• Project Plyer will start as GSoC project maybe


Porting to Raspberry Pi
• Useful for small/cheap standalone systems
• Founded via Crowdsourcing (bountysource.com)
www.DLR.de • Chart 39 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013




Credits

Thanks to the Kivy developers

         • Mathieu Virbel (@mathieuvirbel)

         • Thomas Hansen (@hansent)

         • Gabriel Pettier (@tshirtman)

         • and many others
www.DLR.de • > A.
     > droidcon 2013 Chart 40
     Schreiber • Developing
     Apps for Android and
     Other Platforms with Kivy
     and Python > 09.04.2013




Questions?

 Summary
 •        Kivy allows platform-independent development of
          apps for Android, iOS, Meego, Windows, OSX
          and Linux
 •        Suitable for multi-touch and graphics applications,
          such as kiosk systems, exhibits, games, …

                                 Andreas Schreiber
                                 Twitter: @onyame
                                 http://www.dlr.de/sc

Mais conteúdo relacionado

Semelhante a 20130409 1 developing apps for android with kivy

How to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using PythonHow to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using PythonAndolasoft Inc
 
Android Workshop
Android WorkshopAndroid Workshop
Android WorkshopJunda Ong
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app developmentAbhishekKumar4779
 
Tizen Native Application Development with C/C++
Tizen Native Application Development with C/C++Tizen Native Application Development with C/C++
Tizen Native Application Development with C/C++Gilang Mentari Hamidy
 
Ten Minutes Bluemix Pitch from Dev to Dev
Ten Minutes Bluemix Pitch from Dev to DevTen Minutes Bluemix Pitch from Dev to Dev
Ten Minutes Bluemix Pitch from Dev to DevNiklas Heidloff
 
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...GRUC
 
Open frameworks 101_fitc
Open frameworks 101_fitcOpen frameworks 101_fitc
Open frameworks 101_fitcbenDesigning
 
Compilation Of C/C++ program in Android
Compilation Of C/C++ program in AndroidCompilation Of C/C++ program in Android
Compilation Of C/C++ program in Androidrahulverma1080
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to ZBADR
 
Intro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & ClassesIntro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & ClassesBlue Elephant Consulting
 
Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++Blue Elephant Consulting
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!Édipo Souza
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_authlzongren
 

Semelhante a 20130409 1 developing apps for android with kivy (20)

R meetup 20161011v2
R meetup 20161011v2R meetup 20161011v2
R meetup 20161011v2
 
Pertemuan 3 pm
Pertemuan 3   pmPertemuan 3   pm
Pertemuan 3 pm
 
Presentation1
Presentation1Presentation1
Presentation1
 
How to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using PythonHow to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using Python
 
Session 1 - c++ intro
Session   1 - c++ introSession   1 - c++ intro
Session 1 - c++ intro
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app development
 
Tizen Native Application Development with C/C++
Tizen Native Application Development with C/C++Tizen Native Application Development with C/C++
Tizen Native Application Development with C/C++
 
Ten Minutes Bluemix Pitch from Dev to Dev
Ten Minutes Bluemix Pitch from Dev to DevTen Minutes Bluemix Pitch from Dev to Dev
Ten Minutes Bluemix Pitch from Dev to Dev
 
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...
 
Open frameworks 101_fitc
Open frameworks 101_fitcOpen frameworks 101_fitc
Open frameworks 101_fitc
 
Compilation Of C/C++ program in Android
Compilation Of C/C++ program in AndroidCompilation Of C/C++ program in Android
Compilation Of C/C++ program in Android
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to Z
 
Intro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & ClassesIntro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & Classes
 
Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to Z
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Kivy report
Kivy reportKivy report
Kivy report
 
Project
ProjectProject
Project
 

Mais de Droidcon Berlin

Droidcon de 2014 google cast
Droidcon de 2014   google castDroidcon de 2014   google cast
Droidcon de 2014 google castDroidcon Berlin
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limitsDroidcon Berlin
 
Android industrial mobility
Android industrial mobility Android industrial mobility
Android industrial mobility Droidcon Berlin
 
From sensor data_to_android_and_back
From sensor data_to_android_and_backFrom sensor data_to_android_and_back
From sensor data_to_android_and_backDroidcon Berlin
 
new_age_graphics_android_x86
new_age_graphics_android_x86new_age_graphics_android_x86
new_age_graphics_android_x86Droidcon Berlin
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building AndroidDroidcon Berlin
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentationDroidcon Berlin
 
Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Droidcon Berlin
 
The artofcalabash peterkrauss
The artofcalabash peterkraussThe artofcalabash peterkrauss
The artofcalabash peterkraussDroidcon Berlin
 
Raesch, gries droidcon 2014
Raesch, gries   droidcon 2014Raesch, gries   droidcon 2014
Raesch, gries droidcon 2014Droidcon Berlin
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
20140508 quantified self droidcon
20140508 quantified self droidcon20140508 quantified self droidcon
20140508 quantified self droidconDroidcon Berlin
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devicesDroidcon Berlin
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradioDroidcon Berlin
 
Droidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon Berlin
 

Mais de Droidcon Berlin (20)

Droidcon de 2014 google cast
Droidcon de 2014   google castDroidcon de 2014   google cast
Droidcon de 2014 google cast
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limits
 
crashing in style
crashing in stylecrashing in style
crashing in style
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Android industrial mobility
Android industrial mobility Android industrial mobility
Android industrial mobility
 
Details matter in ux
Details matter in uxDetails matter in ux
Details matter in ux
 
From sensor data_to_android_and_back
From sensor data_to_android_and_backFrom sensor data_to_android_and_back
From sensor data_to_android_and_back
 
droidparts
droidpartsdroidparts
droidparts
 
new_age_graphics_android_x86
new_age_graphics_android_x86new_age_graphics_android_x86
new_age_graphics_android_x86
 
5 tips of monetization
5 tips of monetization5 tips of monetization
5 tips of monetization
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building Android
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentation
 
Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3
 
The artofcalabash peterkrauss
The artofcalabash peterkraussThe artofcalabash peterkrauss
The artofcalabash peterkrauss
 
Raesch, gries droidcon 2014
Raesch, gries   droidcon 2014Raesch, gries   droidcon 2014
Raesch, gries droidcon 2014
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
20140508 quantified self droidcon
20140508 quantified self droidcon20140508 quantified self droidcon
20140508 quantified self droidcon
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devices
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradio
 
Droidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicro
 

Último

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Último (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

20130409 1 developing apps for android with kivy

  • 1. www.DLR.de • Chart 1 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Developing Apps for Android and Other Platforms with Kivy and Python Andreas Schreiber <andreas.schreiber@dlr.de> droidcon 2013, Berlin, 09. April 2013
  • 2. www.DLR.de • Chart 2 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Outline • Introduction • Python • Kivy • Demos • Limitations • Credits
  • 3. www.DLR.de • Chart 3 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Me Scientist, Head of department Founder, CEO Enthusiastic about Python
  • 4. www.DLR.de • Chart 4 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 DLR German Aerospace Center − Research Institution − Space Agency − Project Management Agency
  • 5. www.DLR.de • Chart 5 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Locations and employees 7400 employees across Stade  Hamburg 32 institutes and facilities at  Neustrelitz Bremen   Trauen 16 sites. Berlin  Braunschweig  Offices in Brussels, Paris,  Goettingen Tokyo and Washington. Juelich   Cologne  Bonn ~1400 employees develop software Lampoldshausen  Stuttgart  Augsburg   Oberpfaffenhofen Weilheim 
  • 6. www.DLR.de • Chart 6 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Python
  • 7. Python • General-purpose, high-level programming language • Object-oriented, aspect-oriented, functional • Dynamic type system • Easy-to-learn with clear and expressive syntax def faculty(x): if x > 1: return x * faculty(x - 1) else: return 1
  • 8. www.DLR.de • Chart 8 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Python on Mobile Devices Early Mobile Development with Python • PyS60 for Symbian • Python CE for Windows Mobile Current Mobile Development with Python • Scripting Layer for Android (SL4A) • Python for Android (Py4A) • PySide / Qt for Android • WinRT / IronPython for Windows 8 • Kivy…
  • 9. www.DLR.de • Chart 9 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Kivy
  • 10. www.DLR.de • Chart 10 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Kivy • Platform-independent Python-Framework • Available for • Android • iOS • Meego • Windows kivy.org • Linux • OSX • (Raspberry Pi) • Development in Python on all platforms • Not emulated!
  • 11. www.DLR.de • Chart 11 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Kivy Basics • Framework for Natural User Interfaces (NUI) • Touchscreens / Multi-Touch • GPU accelerated graphics • Based on OpenGL ES 2.0 • Suitable for prototypes as well as products • Porting to new platforms is easy
  • 12. www.DLR.de • Chart 12 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Kivy Software • Open Source (LGPL), 7 Core developer • Source code: https://github.com/kivy • Documentation: http://kivy.org/docs • Kivy on Google Play: https://play.google.com/store/apps/details?id=org.kivy.pygame
  • 13. www.DLR.de • Chart 13 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Kivy says Hello! from kivy.app import App from kivy.uix.button import Button class HelloApp(App): def build(self): return Button(text='Hello Berlin') HelloApp().run()
  • 14. www.DLR.de • Chart 14 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013
  • 15. www.DLR.de • Chart 15 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Development with Kivy • Python for widgets, input, program logic • Language KV for layout und graphics • Cython for low-level access to graphic routines
  • 16. www.DLR.de • Chart 16 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 “Hello Berlin” with KV from kivy.app import App class HelloApp(App): pass HelloApp().run() File hello.kv defines root widget #:kivy 1.0 Button: text: ‘Hello Berlin’
  • 17. www.DLR.de • Chart 17 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Example: 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()
  • 18. www.DLR.de • Chart 18 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Pong Graphics #:kivy 1.6.0 <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"
  • 19. www.DLR.de • Chart 19 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Pong Full example: http://kivy.org/docs/tutorials/pong.html
  • 20. www.DLR.de • Chart 20 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Accessing Java Classes from Python • Smartphones have many APIs • Camera, Compass, Contacts, Location, … • Access from Python via PyJNIus • https://github.com/kivy/pyjnius • Implemented with JNI and Java reflection Example from jnius import autoclass Hardware = autoclass('org.renpy.android.Hardware') print 'DPI is', Hardware.getDPI()
  • 21. www.DLR.de • Chart 21 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Packaging • Creating packages for Windows, OSX, Android und iOS: http://kivy.org/docs/guide/packaging.html
  • 22. www.DLR.de • Chart 22 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Build Tools Tool chain • Python-for-android • Cross compiler for ARM • Android SDK & NDK • Python and some Python packages Buildozer • Hides the complexity: Downloads, compiles, packages Kivy source code • https://github.com/kivy/buildozer % buildozer android debug deploy run
  • 23. www.DLR.de • Chart 23 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Demos
  • 24. www.DLR.de • Chart 24 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Kivy Showcase
  • 25. www.DLR.de • Chart 25 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Kivy Pictures
  • 26. www.DLR.de • Chart 26 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Small Dragon Luki Speech therapy game for kids
  • 27. www.DLR.de • Chart 27 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Small Dragon Luki
  • 28. www.DLR.de • Chart 28 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 MQTT Client
  • 29. www.DLR.de • Folie 29 mobile.cologne > Andreas Schreiber • Plattformübergreifende Apps entwickeln mit Kivy und Python > 08.11.2012 Steering Plant Growth • Webcam takes picture of plants • Computer detects plant • Computer generates an image for lighting • Light source (e.g., a projector) illuminates the plant using the generated image
  • 30. www.DLR.de • Chart 30 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013
  • 31. www.DLR.de • Chart 31 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013
  • 32. www.DLR.de • Chart 32 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013
  • 33. www.DLR.de • Chart 33 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013
  • 34. www.DLR.de • Chart 34 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Other Examples…
  • 37. www.DLR.de • Chart 37 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Limitations
  • 38. www.DLR.de • Chart 38 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Missing, but Planned (or In Progress) User Interface Designer • Design tool for Kivy Language KV • Planned for GSoC Abstraction of mobile APIs • Platform-independent Python wrapper for platform APIs (Android, iOS, Linux/Mac/Windows) • Project Plyer will start as GSoC project maybe Porting to Raspberry Pi • Useful for small/cheap standalone systems • Founded via Crowdsourcing (bountysource.com)
  • 39. www.DLR.de • Chart 39 > droidcon 2013 > A. Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Credits Thanks to the Kivy developers • Mathieu Virbel (@mathieuvirbel) • Thomas Hansen (@hansent) • Gabriel Pettier (@tshirtman) • and many others
  • 40. www.DLR.de • > A. > droidcon 2013 Chart 40 Schreiber • Developing Apps for Android and Other Platforms with Kivy and Python > 09.04.2013 Questions? Summary • Kivy allows platform-independent development of apps for Android, iOS, Meego, Windows, OSX and Linux • Suitable for multi-touch and graphics applications, such as kiosk systems, exhibits, games, … Andreas Schreiber Twitter: @onyame http://www.dlr.de/sc