SlideShare une entreprise Scribd logo
1  sur  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:

Contenu connexe

Tendances

A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to gitEmanuele Olivetti
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version ControlJeremy Coates
 
Version control system
Version control systemVersion control system
Version control systemAndrew Liu
 
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...Edureka!
 
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENTAN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENTGbadeboTEkunola
 
svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드Insub Lee
 
Introduction To Makefile
Introduction To MakefileIntroduction To Makefile
Introduction To MakefileWaqqas Jabbar
 
Introduce to Git and Jenkins
Introduce to Git and JenkinsIntroduce to Git and Jenkins
Introduce to Git and JenkinsAn Nguyen
 
Input output redirection linux
Input output redirection linuxInput output redirection linux
Input output redirection linuxTanishq Soni
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating Systemrenoy reji
 
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...Kuniyasu Suzaki
 

Tendances (20)

A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Versioning avec Git
Versioning avec GitVersioning avec Git
Versioning avec Git
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 
Introduction to Makefile
Introduction to MakefileIntroduction to Makefile
Introduction to Makefile
 
Version control system
Version control systemVersion control system
Version control system
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git commands
Git commandsGit commands
Git commands
 
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
 
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENTAN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
 
svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드
 
Git
GitGit
Git
 
Git.pptx
Git.pptxGit.pptx
Git.pptx
 
Introduction To Makefile
Introduction To MakefileIntroduction To Makefile
Introduction To Makefile
 
Introduce to Git and Jenkins
Introduce to Git and JenkinsIntroduce to Git and Jenkins
Introduce to Git and Jenkins
 
Ch3 gnu make
Ch3 gnu makeCh3 gnu make
Ch3 gnu make
 
Input output redirection linux
Input output redirection linuxInput output redirection linux
Input output redirection linux
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating System
 
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
 
TMUX Rocks!
TMUX Rocks!TMUX Rocks!
TMUX Rocks!
 

En vedette

Standalone Android Apps in Python
Standalone Android Apps in PythonStandalone Android Apps in Python
Standalone Android Apps in PythonBaptiste Lagarde
 
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
 

En vedette (7)

Standalone Android Apps in Python
Standalone Android Apps in PythonStandalone Android Apps in Python
Standalone Android Apps in Python
 
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)
 

Similaire à 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
 

Similaire à 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
 

Dernier

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 

Dernier (20)

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 

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: