SlideShare a Scribd company logo
1 of 14
Introduction
to Kivy
A Cross-Platform Python UI Library
In this Session we shall
discuss:
 How to setup kivy
 Some key features of kivy
 Make a simple ‘Hello World’ application
 Introduce the ‘kv’ language
 Package the application for the android market
Setting up Kivy
3 very simple commands:
1. Add Source
 sudo add-apt-repository ppa:kivy-team/kivy
2. Update
 sudo apt-get update
3. Install Kivy
 sudo apt-get install python-kivy

Basic Components of Kivy
§ App
§ Widget
§ ScreenManger
§ Screen
§ Layouts
§ Button
§ Label
§ TextInput
§ Image
§ Clock
§ SoundLoader
§ Animation
Types of Layouts
§ Anchor Layout
§ Box Layout
§ Float Layout
§ Relative Layout
§ Grid Layout
§ Stack Layout
Hello World
f r o m k i v y . a p p i m p o r t A p p
f r o m k i v y . u i x . f l o a t l a y o u t i m p o r t F l o a t L a y o u t
f r o m k i v y . u i x . b u t t o n i m p o r t B u t t o n
f r o m k i v y . u i x . l a b e l i m p o r t L a b e l
c l a s s M y A p p ( A p p ) :
t i t l e = ' H e l l o W o r l d '
d e f b u i l d ( s e l f ) :
s e l f . a p p w i n d o w = F l o a t L a y o u t ( )
b u t t o n = B u t t o n ( t e x t = ' C l i c k H e r e ' )
b u t t o n . b i n d ( o n _ r e l e a s e = s e l f . b u t t o n p r e s s )
s e l f . a p p w i n d o w . a d d _ w i d g e t ( b u t t o n )
r e t u r n s e l f . a p p w i n d o w
d e f b u t t o n p r e s s ( s e l f , * a r g s ) :
s e l f . a p p w i n d o w . c l e a r _ w i d g e t s ( )
s e l f . a p p w i n d o w . a d d _ w i d g e t ( L a b e l ( t e x t = ' H e l l o W o r l d ! ' ) )
i f _ _ n a m e _ _ = = ' _ _ m a i n _ _ ' :
g l o b a l m y a p p
m y a p p = M y A p p ( )
m y a p p . r u n ( )
The ‘kv’ Language
class MyButton(Button):
def __init__(self,**kwargs):
super(MyButton,self).__init__(**kwargs)
<MyButton>:
size_hint_x: None
size_hint_y: None
In the kv file:
In the python file:
Packaging the app
There are two ways to package the
app:
1. Manually using python-for-android
2.
3. Automatically using buildozer
Prerequisites for manual
packaging:
§ Build-Essential and others:
§ sudo apt-get install build-essential patch git-core ccache ant python-pip python-dev
§ Latest Cython:
§ Pip install –upgrade cython
§ Android SDK
§ http://developer.android.com/sdk/index.html
§ Android NDK
§ http://developer.android.com/sdk/ndk/index.html
§ Environment variables
§ export ANDROIDSDK=/path/to/android-sdk
§ export ANDROIDNDK=/path/to/android-ndk
§ export ANDROIDNDKVER=rX
§ export ANDROIDAPI=X
§ export PATH=$ANDROIDNDK:$ANDROIDSDK/platform-tools:$ANDROIDSDK/tools:
$PATH
§
Manually
§ Get python-for-android:
§ git clone git://github.com/kivy/python-for-android
§ Create distribution:
§ ./distribute.sh -m "kivy"
§ Build apk:
§ cd dist/default
§ ./build.py --dir <path to your app>
--name "<title>"
--package <org.of.your.app>
--version <human version>
--icon <path to an icon to use>
--orientation <landscape|portrait>
--permission <android permission like VIBRATE> (multiple
allowed)
<debug|release>
Automatic Packaging
using buildozer:
§ Get buildozer:
§ git clone https://github.com/kivy/buildozer.git
§ cd buildozer
§ sudo python2.7 setup.py install
§ Create spec file:
§ cd path/to/app
§ buildozer init
§ Build:
§ buildozer android <debug|release>
Signing and Aligning
(Only for Release apk)
§ Generate keystore
§ keytool -genkey -v -keystore
path/to/keystore/name.keystore -alias myalias
-keyalg RSA -keysize 2048 -validity 10000
§ <New Password>
§ Sign using keystore
§ jarsigner -verbose -sigalg SHA1withRSA -digestalg
SHA1 -keystore ./keystores/com-mydomain-
myapp.keystore ./myapp/bin/MyApp-1.0.0-
release-unsigned.apk myalias
§ <keystore password>
§ Zipalign
§ ~/.buildozer/android/platform/android-sdk-
21/tools/zipalign -v 4 ./myapp/bin/MyApp-1.0.0-
release-unsigned.apk ./myapp/bin/MyApp-
1.0.0.apk
All Done!
Congratulations on your first apk!
Thank You!

More Related Content

What's hot

Seccomp Profiles and you: A practical guide.
Seccomp Profiles and you: A practical guide.Seccomp Profiles and you: A practical guide.
Seccomp Profiles and you: A practical guide.Duffie Cooley
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionAnwarul Islam
 
Introduction to CI/CD
Introduction to CI/CDIntroduction to CI/CD
Introduction to CI/CDHoang Le
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Etsuji Nakai
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash CourseNilay Binjola
 
An Introduction To Jenkins
An Introduction To JenkinsAn Introduction To Jenkins
An Introduction To JenkinsKnoldus Inc.
 
Flutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessBartosz Kosarzycki
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Simplilearn
 
GitHub Actions with Node.js
GitHub Actions with Node.jsGitHub Actions with Node.js
GitHub Actions with Node.jsStefan Stölzle
 
Intro to Github Actions @likecoin
Intro to Github Actions @likecoinIntro to Github Actions @likecoin
Intro to Github Actions @likecoinWilliam Chong
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
Continuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub ActionsContinuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub ActionsJeff Geerling
 
Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github ActionsKnoldus Inc.
 

What's hot (20)

Seccomp Profiles and you: A practical guide.
Seccomp Profiles and you: A practical guide.Seccomp Profiles and you: A practical guide.
Seccomp Profiles and you: A practical guide.
 
BitBucket presentation
BitBucket presentationBitBucket presentation
BitBucket presentation
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training Session
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Appium
AppiumAppium
Appium
 
Introduction to CI/CD
Introduction to CI/CDIntroduction to CI/CD
Introduction to CI/CD
 
CI/CD with GitHub Actions
CI/CD with GitHub ActionsCI/CD with GitHub Actions
CI/CD with GitHub Actions
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
An Introduction To Jenkins
An Introduction To JenkinsAn Introduction To Jenkins
An Introduction To Jenkins
 
Flutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for business
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
 
GitHub Actions with Node.js
GitHub Actions with Node.jsGitHub Actions with Node.js
GitHub Actions with Node.js
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Intro to Github Actions @likecoin
Intro to Github Actions @likecoinIntro to Github Actions @likecoin
Intro to Github Actions @likecoin
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Continuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub ActionsContinuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub Actions
 
Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github Actions
 
Git basics
Git basicsGit basics
Git basics
 

Viewers also liked

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é
 
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
 
Palestra Apresentando Python e Suas Aplicações
Palestra Apresentando Python e Suas AplicaçõesPalestra Apresentando Python e Suas Aplicações
Palestra Apresentando Python e Suas AplicaçõesMarcos Thomaz
 
Desenvolvendo aplicações Mobile em Python
Desenvolvendo aplicações Mobile em PythonDesenvolvendo aplicações Mobile em Python
Desenvolvendo aplicações Mobile em PythonRelsi Maron
 
Kivy - Python Nordeste 2013
Kivy - Python Nordeste 2013Kivy - Python Nordeste 2013
Kivy - Python Nordeste 2013Diego Dukão
 
Desenvolvendo Aplicações Web com Python
Desenvolvendo Aplicações Web com PythonDesenvolvendo Aplicações Web com Python
Desenvolvendo Aplicações Web com PythonLuiz Cláudio Silva
 
A Basic Django Introduction
A Basic Django IntroductionA Basic Django Introduction
A Basic Django IntroductionGanga Ram
 
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
 
Mikrotik ultimo manual
Mikrotik ultimo manualMikrotik ultimo manual
Mikrotik ultimo manualChristian Val
 
Mikrotik passo a passo
Mikrotik   passo a passoMikrotik   passo a passo
Mikrotik passo a passoIvan de Sousa
 
Python para iniciantes
Python para iniciantesPython para iniciantes
Python para iniciantesrichardsonlima
 

Viewers also liked (18)

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
 
Developing apps with Kivy
Developing apps with KivyDeveloping apps with Kivy
Developing apps with Kivy
 
Creando Aplicaciones para Android con Kivy
Creando Aplicaciones para Android con KivyCreando Aplicaciones para Android con Kivy
Creando Aplicaciones para Android con Kivy
 
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
 
Palestra Apresentando Python e Suas Aplicações
Palestra Apresentando Python e Suas AplicaçõesPalestra Apresentando Python e Suas Aplicações
Palestra Apresentando Python e Suas Aplicações
 
Desenvolvendo aplicações Mobile em Python
Desenvolvendo aplicações Mobile em PythonDesenvolvendo aplicações Mobile em Python
Desenvolvendo aplicações Mobile em Python
 
Kivy - Python Nordeste 2013
Kivy - Python Nordeste 2013Kivy - Python Nordeste 2013
Kivy - Python Nordeste 2013
 
Desenvolvendo Aplicações Web com Python
Desenvolvendo Aplicações Web com PythonDesenvolvendo Aplicações Web com Python
Desenvolvendo Aplicações Web com Python
 
A Basic Django Introduction
A Basic Django IntroductionA Basic Django Introduction
A Basic Django Introduction
 
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)
 
Curso oficial Mikrotik
Curso oficial MikrotikCurso oficial Mikrotik
Curso oficial Mikrotik
 
Mikrotik ultimo manual
Mikrotik ultimo manualMikrotik ultimo manual
Mikrotik ultimo manual
 
Mikrotik passo a passo
Mikrotik   passo a passoMikrotik   passo a passo
Mikrotik passo a passo
 
Python para iniciantes
Python para iniciantesPython para iniciantes
Python para iniciantes
 
Curso de Python e Django
Curso de Python e DjangoCurso de Python e Django
Curso de Python e Django
 
Xamarin.forms入門
Xamarin.forms入門Xamarin.forms入門
Xamarin.forms入門
 
Sem5 2016 (1)
Sem5 2016 (1)Sem5 2016 (1)
Sem5 2016 (1)
 

Similar to Kivy - Python UI Library for Any Platform

Flask jwt authentication tutorial
Flask jwt authentication tutorialFlask jwt authentication tutorial
Flask jwt authentication tutorialKaty Slemon
 
Vipul divyanshu documentation on Kinect and Motion Tracking
Vipul divyanshu documentation  on Kinect and Motion TrackingVipul divyanshu documentation  on Kinect and Motion Tracking
Vipul divyanshu documentation on Kinect and Motion TrackingVipul Divyanshu
 
Fastlane for Androidによる継続的デリバリー
Fastlane for Androidによる継続的デリバリーFastlane for Androidによる継続的デリバリー
Fastlane for Androidによる継続的デリバリーFumiya Nakamura
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingHenry Schreiner
 
WordPress in 30 minutes
WordPress in 30 minutesWordPress in 30 minutes
WordPress in 30 minutesOwen Winkler
 
Comment développer sur la console Xbox One avec une application Universal Win...
Comment développer sur la console Xbox One avec une application Universal Win...Comment développer sur la console Xbox One avec une application Universal Win...
Comment développer sur la console Xbox One avec une application Universal Win...Microsoft
 
Dailymotion presenting xbox one experience days by damien delaire
Dailymotion presenting xbox one experience days by damien delaireDailymotion presenting xbox one experience days by damien delaire
Dailymotion presenting xbox one experience days by damien delaireDamien Delaire
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 MinigamesSusan Gold
 
The Ring programming language version 1.7 book - Part 82 of 196
The Ring programming language version 1.7 book - Part 82 of 196The Ring programming language version 1.7 book - Part 82 of 196
The Ring programming language version 1.7 book - Part 82 of 196Mahmoud Samir Fayed
 
Introduction to Box2D Physics Engine
Introduction to Box2D Physics EngineIntroduction to Box2D Physics Engine
Introduction to Box2D Physics Enginefirstthumb
 
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet Pôle Systematic Paris-Region
 
GitGot: The Swiss Army Chainsaw of Git Repo Management
GitGot: The Swiss Army Chainsaw of Git Repo ManagementGitGot: The Swiss Army Chainsaw of Git Repo Management
GitGot: The Swiss Army Chainsaw of Git Repo ManagementJohn Anderson
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiFlorent Batard
 
The Ring programming language version 1.6 book - Part 7 of 189
The Ring programming language version 1.6 book - Part 7 of 189The Ring programming language version 1.6 book - Part 7 of 189
The Ring programming language version 1.6 book - Part 7 of 189Mahmoud Samir Fayed
 
PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!Blanca Mancilla
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Développer sur la console Xbox One avec une application UWP. Les retours d'éx...
Développer sur la console Xbox One avec une application UWP. Les retours d'éx...Développer sur la console Xbox One avec une application UWP. Les retours d'éx...
Développer sur la console Xbox One avec une application UWP. Les retours d'éx...Dailymotion
 
Open source software for startups
Open source software for startupsOpen source software for startups
Open source software for startupsvictorneo
 

Similar to Kivy - Python UI Library for Any Platform (20)

Flask jwt authentication tutorial
Flask jwt authentication tutorialFlask jwt authentication tutorial
Flask jwt authentication tutorial
 
Vipul divyanshu documentation on Kinect and Motion Tracking
Vipul divyanshu documentation  on Kinect and Motion TrackingVipul divyanshu documentation  on Kinect and Motion Tracking
Vipul divyanshu documentation on Kinect and Motion Tracking
 
Fastlane for Androidによる継続的デリバリー
Fastlane for Androidによる継続的デリバリーFastlane for Androidによる継続的デリバリー
Fastlane for Androidによる継続的デリバリー
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance Tooling
 
WordPress in 30 minutes
WordPress in 30 minutesWordPress in 30 minutes
WordPress in 30 minutes
 
Comment développer sur la console Xbox One avec une application Universal Win...
Comment développer sur la console Xbox One avec une application Universal Win...Comment développer sur la console Xbox One avec une application Universal Win...
Comment développer sur la console Xbox One avec une application Universal Win...
 
Dailymotion presenting xbox one experience days by damien delaire
Dailymotion presenting xbox one experience days by damien delaireDailymotion presenting xbox one experience days by damien delaire
Dailymotion presenting xbox one experience days by damien delaire
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
Survey_Paper
Survey_PaperSurvey_Paper
Survey_Paper
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 Minigames
 
The Ring programming language version 1.7 book - Part 82 of 196
The Ring programming language version 1.7 book - Part 82 of 196The Ring programming language version 1.7 book - Part 82 of 196
The Ring programming language version 1.7 book - Part 82 of 196
 
Introduction to Box2D Physics Engine
Introduction to Box2D Physics EngineIntroduction to Box2D Physics Engine
Introduction to Box2D Physics Engine
 
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
 
GitGot: The Swiss Army Chainsaw of Git Repo Management
GitGot: The Swiss Army Chainsaw of Git Repo ManagementGitGot: The Swiss Army Chainsaw of Git Repo Management
GitGot: The Swiss Army Chainsaw of Git Repo Management
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansai
 
The Ring programming language version 1.6 book - Part 7 of 189
The Ring programming language version 1.6 book - Part 7 of 189The Ring programming language version 1.6 book - Part 7 of 189
The Ring programming language version 1.6 book - Part 7 of 189
 
PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Développer sur la console Xbox One avec une application UWP. Les retours d'éx...
Développer sur la console Xbox One avec une application UWP. Les retours d'éx...Développer sur la console Xbox One avec une application UWP. Les retours d'éx...
Développer sur la console Xbox One avec une application UWP. Les retours d'éx...
 
Open source software for startups
Open source software for startupsOpen source software for startups
Open source software for startups
 

Recently uploaded

Introduction to Artificial intelligence.
Introduction to Artificial intelligence.Introduction to Artificial intelligence.
Introduction to Artificial intelligence.thamaeteboho94
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lodhisaajjda
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Baileyhlharris
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityHung Le
 
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfSOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfMahamudul Hasan
 
Zone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptxZone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptxlionnarsimharajumjf
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...ZurliaSoop
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIINhPhngng3
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalFabian de Rijk
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfSkillCertProExams
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...amilabibi1
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatmentnswingard
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoKayode Fayemi
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...David Celestin
 

Recently uploaded (17)

Introduction to Artificial intelligence.
Introduction to Artificial intelligence.Introduction to Artificial intelligence.
Introduction to Artificial intelligence.
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
 
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfSOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
 
Zone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptxZone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptx
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of Drupal
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait Cityin kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
 

Kivy - Python UI Library for Any Platform

  • 2. In this Session we shall discuss:  How to setup kivy  Some key features of kivy  Make a simple ‘Hello World’ application  Introduce the ‘kv’ language  Package the application for the android market
  • 3. Setting up Kivy 3 very simple commands: 1. Add Source  sudo add-apt-repository ppa:kivy-team/kivy 2. Update  sudo apt-get update 3. Install Kivy  sudo apt-get install python-kivy 
  • 4. Basic Components of Kivy § App § Widget § ScreenManger § Screen § Layouts § Button § Label § TextInput § Image § Clock § SoundLoader § Animation
  • 5. Types of Layouts § Anchor Layout § Box Layout § Float Layout § Relative Layout § Grid Layout § Stack Layout
  • 6. Hello World f r o m k i v y . a p p i m p o r t A p p f r o m k i v y . u i x . f l o a t l a y o u t i m p o r t F l o a t L a y o u t f r o m k i v y . u i x . b u t t o n i m p o r t B u t t o n f r o m k i v y . u i x . l a b e l i m p o r t L a b e l c l a s s M y A p p ( A p p ) : t i t l e = ' H e l l o W o r l d ' d e f b u i l d ( s e l f ) : s e l f . a p p w i n d o w = F l o a t L a y o u t ( ) b u t t o n = B u t t o n ( t e x t = ' C l i c k H e r e ' ) b u t t o n . b i n d ( o n _ r e l e a s e = s e l f . b u t t o n p r e s s ) s e l f . a p p w i n d o w . a d d _ w i d g e t ( b u t t o n ) r e t u r n s e l f . a p p w i n d o w d e f b u t t o n p r e s s ( s e l f , * a r g s ) : s e l f . a p p w i n d o w . c l e a r _ w i d g e t s ( ) s e l f . a p p w i n d o w . a d d _ w i d g e t ( L a b e l ( t e x t = ' H e l l o W o r l d ! ' ) ) i f _ _ n a m e _ _ = = ' _ _ m a i n _ _ ' : g l o b a l m y a p p m y a p p = M y A p p ( ) m y a p p . r u n ( )
  • 7. The ‘kv’ Language class MyButton(Button): def __init__(self,**kwargs): super(MyButton,self).__init__(**kwargs) <MyButton>: size_hint_x: None size_hint_y: None In the kv file: In the python file:
  • 8. Packaging the app There are two ways to package the app: 1. Manually using python-for-android 2. 3. Automatically using buildozer
  • 9. Prerequisites for manual packaging: § Build-Essential and others: § sudo apt-get install build-essential patch git-core ccache ant python-pip python-dev § Latest Cython: § Pip install –upgrade cython § Android SDK § http://developer.android.com/sdk/index.html § Android NDK § http://developer.android.com/sdk/ndk/index.html § Environment variables § export ANDROIDSDK=/path/to/android-sdk § export ANDROIDNDK=/path/to/android-ndk § export ANDROIDNDKVER=rX § export ANDROIDAPI=X § export PATH=$ANDROIDNDK:$ANDROIDSDK/platform-tools:$ANDROIDSDK/tools: $PATH §
  • 10. Manually § Get python-for-android: § git clone git://github.com/kivy/python-for-android § Create distribution: § ./distribute.sh -m "kivy" § Build apk: § cd dist/default § ./build.py --dir <path to your app> --name "<title>" --package <org.of.your.app> --version <human version> --icon <path to an icon to use> --orientation <landscape|portrait> --permission <android permission like VIBRATE> (multiple allowed) <debug|release>
  • 11. Automatic Packaging using buildozer: § Get buildozer: § git clone https://github.com/kivy/buildozer.git § cd buildozer § sudo python2.7 setup.py install § Create spec file: § cd path/to/app § buildozer init § Build: § buildozer android <debug|release>
  • 12. Signing and Aligning (Only for Release apk) § Generate keystore § keytool -genkey -v -keystore path/to/keystore/name.keystore -alias myalias -keyalg RSA -keysize 2048 -validity 10000 § <New Password> § Sign using keystore § jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ./keystores/com-mydomain- myapp.keystore ./myapp/bin/MyApp-1.0.0- release-unsigned.apk myalias § <keystore password> § Zipalign § ~/.buildozer/android/platform/android-sdk- 21/tools/zipalign -v 4 ./myapp/bin/MyApp-1.0.0- release-unsigned.apk ./myapp/bin/MyApp- 1.0.0.apk
  • 13. All Done! Congratulations on your first apk!