SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Pycon 2016
Developing Apps for Android and Other
Platforms with Kivy and Python
Pushpendra Tiwari
Outline
 Introduction
 Python
 Kivy
 Limitations
 Credits
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
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…
Kivy
Kivy
 Platform-independent Python-
Framework
 Available for
 Android
 iOS
 Meego
 Windows
 Linux
 OSX
 (Raspberry Pi)
 Development in Python on all
platforms
 Not emulated!
kivy.org
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
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
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()
Development with Kivy
 Python for widgets, input, program logic
• Language KV for layout und graphics
• Cython for low-level access to graphic routines
“Hello Berlin” with KV
from kivy.app import App
class HelloApp(App): pass
HelloApp().run()
#:kivy 1.0
Button:
text: ‘Hello Berlin’
File hello.kv
defines root widget
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()
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"
Pong
Full example: http://kivy.org/docs/tutorials/pong.html
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()
Packaging
 Creating packages for Windows, OSX, Android und iOS:
http://kivy.org/docs/guide/packaging.html
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
Kivy Showcase
Limitations
Missing, but Planned (or In Progress)
User Interface Designer
 Design tool for Kivy Language KV
Abstraction of mobile APIs
• Platform-independent Python wrapper for platform APIs (Android, iOS,
Linux/Mac/Windows)
Porting to Raspberry Pi
• Useful for small/cheap standalone systems
Credits
Thanks to the Kivy developers
 Mathieu Virbel (@mathieuvirbel)
• Thomas Hansen (@hansent)
• Gabriel Pettier (@tshirtman)
• and many others
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, …er Twitter:

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android StudioSuyash Srijan
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programmingSrinivas Narasegouda
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaEdureka!
 
Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...Simplilearn
 
Introduction To Python | Edureka
Introduction To Python | EdurekaIntroduction To Python | Edureka
Introduction To Python | EdurekaEdureka!
 
Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I Atif AbbAsi
 
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYAPYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYAMaulik Borsaniya
 
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...Edureka!
 
POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE teachersduniya.com
 
Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming KrishnaMildain
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Edureka!
 
Eclipse introduction IDE PRESENTATION
Eclipse introduction IDE PRESENTATIONEclipse introduction IDE PRESENTATION
Eclipse introduction IDE PRESENTATIONAYESHA JAVED
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonManishJha237
 

Was ist angesagt? (20)

Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 
Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...
 
Python
PythonPython
Python
 
Python Intro
Python IntroPython Intro
Python Intro
 
Introduction To Python | Edureka
Introduction To Python | EdurekaIntroduction To Python | Edureka
Introduction To Python | Edureka
 
Functions in Python
Functions in PythonFunctions in Python
Functions in Python
 
Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I
 
Basics of python
Basics of pythonBasics of python
Basics of python
 
Python Basics.pdf
Python Basics.pdfPython Basics.pdf
Python Basics.pdf
 
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYAPYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
 
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
 
POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE
 
Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
 
Eclipse introduction IDE PRESENTATION
Eclipse introduction IDE PRESENTATIONEclipse introduction IDE PRESENTATION
Eclipse introduction IDE PRESENTATION
 
Python basic
Python basicPython basic
Python basic
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 

Andere mochten auch

Standalone Android Apps in Python
Standalone Android Apps in PythonStandalone Android Apps in Python
Standalone Android Apps in PythonBaptiste Lagarde
 
Kivy - Python UI Library for Any Platform
Kivy - Python UI Library for Any PlatformKivy - Python UI Library for Any Platform
Kivy - Python UI Library for Any PlatformSaurav Singhi
 
Creando Aplicaciones para Android con Kivy
Creando Aplicaciones para Android con KivyCreando Aplicaciones para Android con Kivy
Creando Aplicaciones para Android con KivyNahuel Defossé
 
Extracción de datos de páginas web con Python (webscraping)
Extracción de datos de páginas web con Python (webscraping)Extracción de datos de páginas web con Python (webscraping)
Extracción de datos de páginas web con Python (webscraping)Ernesto Crespo
 
Desarrollo de aplicaciones multiplataforma con python y Kivy
Desarrollo de aplicaciones multiplataforma con python y KivyDesarrollo de aplicaciones multiplataforma con python y Kivy
Desarrollo de aplicaciones multiplataforma con python y KivyErnesto Crespo
 
Remote Control your PC using Python and Kivy
Remote Control your PC using Python and KivyRemote Control your PC using Python and Kivy
Remote Control your PC using Python and KivyVengat Vasanth
 

Andere mochten auch (8)

Standalone Android Apps in Python
Standalone Android Apps in PythonStandalone Android Apps in Python
Standalone Android Apps in Python
 
Kivy - Python UI Library for Any Platform
Kivy - Python UI Library for Any PlatformKivy - Python UI Library for Any Platform
Kivy - Python UI Library for Any Platform
 
Kivy for you
Kivy for youKivy for you
Kivy for you
 
Creando Aplicaciones para Android con Kivy
Creando Aplicaciones para Android con KivyCreando Aplicaciones para Android con Kivy
Creando Aplicaciones para Android con Kivy
 
Extracción de datos de páginas web con Python (webscraping)
Extracción de datos de páginas web con Python (webscraping)Extracción de datos de páginas web con Python (webscraping)
Extracción de datos de páginas web con Python (webscraping)
 
Desarrollo de aplicaciones multiplataforma con python y Kivy
Desarrollo de aplicaciones multiplataforma con python y KivyDesarrollo de aplicaciones multiplataforma con python y Kivy
Desarrollo de aplicaciones multiplataforma con python y Kivy
 
Remote Control your PC using Python and Kivy
Remote Control your PC using Python and KivyRemote Control your PC using Python and Kivy
Remote Control your PC using Python and Kivy
 
Sem5 2016 (1)
Sem5 2016 (1)Sem5 2016 (1)
Sem5 2016 (1)
 

Ähnlich wie Developing apps with Kivy

MOBILE APP DEVELOPMENT USING PYTHON
MOBILE APP DEVELOPMENT USING PYTHONMOBILE APP DEVELOPMENT USING PYTHON
MOBILE APP DEVELOPMENT USING PYTHONPriyadharshiniVS
 
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
 
Developing Online Application with Kivy A Python Framework
Developing Online Application with Kivy A Python FrameworkDeveloping Online Application with Kivy A Python Framework
Developing Online Application with Kivy A Python Frameworkijtsrd
 
Run your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryRun your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryAndy Piper
 
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)jaxLondonConference
 
iOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyiOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyNick Landry
 
Ionic App Platform Overview
Ionic App Platform Overview Ionic App Platform Overview
Ionic App Platform Overview Ionic Framework
 
Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseJen Looper
 
.NET Innovations and Improvements
.NET Innovations and Improvements.NET Innovations and Improvements
.NET Innovations and ImprovementsJeff Chu
 
voice recognition security system ppt
voice recognition security system pptvoice recognition security system ppt
voice recognition security system pptNitesh Dubey
 
iOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for JasakomeriOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for JasakomerAndri Yadi
 
PyQt Application Development On Maemo
PyQt Application Development On MaemoPyQt Application Development On Maemo
PyQt Application Development On Maemoachipa
 
Xamarin Open House talk - Sela Group - Ofir Makmal
Xamarin Open House talk - Sela Group - Ofir MakmalXamarin Open House talk - Sela Group - Ofir Makmal
Xamarin Open House talk - Sela Group - Ofir MakmalOfir Makmal
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodepCloudy
 
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...Samsung Open Source Group
 
Visual Studio 2017 Launch Event
Visual Studio 2017 Launch EventVisual Studio 2017 Launch Event
Visual Studio 2017 Launch EventJames Montemagno
 
Recent Developments in Free Medical Imaging Software
Recent Developments in Free Medical Imaging SoftwareRecent Developments in Free Medical Imaging Software
Recent Developments in Free Medical Imaging SoftwareAndrew Crabb
 

Ähnlich wie Developing apps with Kivy (20)

MOBILE APP DEVELOPMENT USING PYTHON
MOBILE APP DEVELOPMENT USING PYTHONMOBILE APP DEVELOPMENT USING PYTHON
MOBILE APP DEVELOPMENT USING PYTHON
 
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
 
Kivy report
Kivy reportKivy report
Kivy report
 
Developing Online Application with Kivy A Python Framework
Developing Online Application with Kivy A Python FrameworkDeveloping Online Application with Kivy A Python Framework
Developing Online Application with Kivy A Python Framework
 
Run your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryRun your Java apps on Cloud Foundry
Run your Java apps on Cloud Foundry
 
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
 
iOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyiOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET Guy
 
Ionic App Platform Overview
Ionic App Platform Overview Ionic App Platform Overview
Ionic App Platform Overview
 
Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and Firebase
 
Course overview 1
Course overview   1Course overview   1
Course overview 1
 
Hyperloop
HyperloopHyperloop
Hyperloop
 
.NET Innovations and Improvements
.NET Innovations and Improvements.NET Innovations and Improvements
.NET Innovations and Improvements
 
voice recognition security system ppt
voice recognition security system pptvoice recognition security system ppt
voice recognition security system ppt
 
iOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for JasakomeriOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for Jasakomer
 
PyQt Application Development On Maemo
PyQt Application Development On MaemoPyQt Application Development On Maemo
PyQt Application Development On Maemo
 
Xamarin Open House talk - Sela Group - Ofir Makmal
Xamarin Open House talk - Sela Group - Ofir MakmalXamarin Open House talk - Sela Group - Ofir Makmal
Xamarin Open House talk - Sela Group - Ofir Makmal
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with Xcode
 
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
 
Visual Studio 2017 Launch Event
Visual Studio 2017 Launch EventVisual Studio 2017 Launch Event
Visual Studio 2017 Launch Event
 
Recent Developments in Free Medical Imaging Software
Recent Developments in Free Medical Imaging SoftwareRecent Developments in Free Medical Imaging Software
Recent Developments in Free Medical Imaging Software
 

Kürzlich hochgeladen

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 

Kürzlich hochgeladen (20)

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

Developing apps with Kivy

  • 1. Pycon 2016 Developing Apps for Android and Other Platforms with Kivy and Python Pushpendra Tiwari
  • 2. Outline  Introduction  Python  Kivy  Limitations  Credits
  • 4. 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
  • 5. 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…
  • 7. Kivy  Platform-independent Python- Framework  Available for  Android  iOS  Meego  Windows  Linux  OSX  (Raspberry Pi)  Development in Python on all platforms  Not emulated! kivy.org
  • 8. 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
  • 9. 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
  • 10. 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()
  • 11.
  • 12. Development with Kivy  Python for widgets, input, program logic • Language KV for layout und graphics • Cython for low-level access to graphic routines
  • 13. “Hello Berlin” with KV from kivy.app import App class HelloApp(App): pass HelloApp().run() #:kivy 1.0 Button: text: ‘Hello Berlin’ File hello.kv defines root widget
  • 14. 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()
  • 15. 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"
  • 17. 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()
  • 18. Packaging  Creating packages for Windows, OSX, Android und iOS: http://kivy.org/docs/guide/packaging.html
  • 19. 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
  • 22. Missing, but Planned (or In Progress) User Interface Designer  Design tool for Kivy Language KV Abstraction of mobile APIs • Platform-independent Python wrapper for platform APIs (Android, iOS, Linux/Mac/Windows) Porting to Raspberry Pi • Useful for small/cheap standalone systems
  • 23. Credits Thanks to the Kivy developers  Mathieu Virbel (@mathieuvirbel) • Thomas Hansen (@hansent) • Gabriel Pettier (@tshirtman) • and many others
  • 24. 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, …er Twitter: