SlideShare a Scribd company logo
1 of 19
Download to read offline
STANDALONE ANDROID APPS IN PYTHON
Baptiste Lagarde
Sydney Python Group, 2013.11.07
I. Toolchain
II. Kivy
JAVA APP VS. PYTHON APP

Python cross-compiled for ARM using the Android NDK
Android NDK - The Native Development Kit allows you to implement parts
of your app using native-code languages such as C and C++.
I. TOOLCHAIN
TOOLCHAIN (1/5)
Overview

http://python-for-android.readthedocs.org/en/latest/toolchain/
TOOLCHAIN (2/5)
Prerequisites ~6GB (sigh)
Option A
Download Android SDK + NDK
Follow pages and pages of Google instructions
Download more stuff from inside Eclipse (?!)
Set-up some environment variables
git clone ..., pip install ...
Option B
Download .vbi virtual machine image
Run with virtualbox
TOOLCHAIN (2/5)
TOOLCHAIN (2/5)
TOOLCHAIN (3/5)
Cross-compilation

Distribute

kv@iyVrulo:/nri/yhnfradod .dsrbt.h- kv
iykv-itaBx~adodpto-o-nri$ /itiues m iy

1. Creates a host Python
2. Compiles an ARM Python
3. Opt-in recipes with -m
Modules
Some Standard Library modules excluded by default to save space
Pure python modules can simply be included with the app's code
Many modules are available as "recipes"
TOOLCHAIN (4/5)
Make Kivy App
Kivy - Open source Python library for rapid development of applications
that make use of innovative user interfaces, such as multi-touch apps.
#ts.y
etp
ipr kv
mot iy
fo kv.p ipr Ap
rm iyap mot p
fo kv.i.utnipr Bto
rm iyuxbto mot utn
casTsApAp:
ls etp(p)
dfbidsl)
e ul(ef:
rtr Bto(et'el Wrd)
eun utntx=Hlo ol'
i _nm_ = '_an_:
f _ae_ = _mi_'
TsAp)rn)
etp(.u(
$pto ts.y
yhn etp
TOOLCHAIN (5/5)
Build and Install
Build

$c ~adodpto-o-nri/itdfut
d /nri/yhnfradodds/eal
$.bidp -pcaecmeapemap-nm "yp"-vrin1-dr/aht/iyap
/ul.y -akg o.xml.yp -ae MAp -eso
-i pt/okv/p/

Install
Phone: Settings > Developer options > USB debugging
$abisalbnMAp1dbgak
d ntl i/yp--eu.p

...or simply open the .apk on the phone (transfer by email, USB, Dropbox, ...)
TOOLCHAIN (5/5)
II. KIVY
The KV language
Accessing the hardware
Useful resources
KIVY (1/5)
Example app

(Saves the phone's accelerometer readings to CSV)
KIVY (2/5)
The KV Language
Features
Move UI declaration to separate file
Root widget
Templates
Widget classes, inheritance
Anything right of ":" is Python!
Python imports
Event bindings , e.g. on_press
Keyword arguments
Hooks, e.g. id, root, app, self

Bxaot
oLyu:
oinain "etcl
retto: vria"
Lbl
ae:
i:ito
d nr
TxIpt
etnu:
i:pt
d ah
mliie Fle
utln: as
o_etvldt:apstah)
ntx_aiae p.ept(
Lbl
ae:
i:pors
d rges
Bxaot
oLyu:
oinain "oiotl
retto: hrzna"
Bto:
utn
tx:"tr cpue
et Sat atr"
o_rs:apsat)
npes p.tr(
Bto:
utn
tx:"tpcpue
et So atr"
o_rs:apso(
npes p.tp)
Bto:
utn
tx:"ut
et Qi"
o_rs:ei(
npes xt)
KIVY (3/5)
Accessing the hardware with pyjnius
pyjnius - Python module to access Java classes as Python classes, using JNI.
JNI - The Java Native Interface is a programming framework that enables
Java code running in a Java Virtual Machine to call, and to be called by,
native applications and libraries written in other languages
>>fo jisipr atcas
> rm nu mot uols
>>Hrwr =atcas'r.ep.nri.adae)
> adae
uols(ogrnyadodHrwr'
>>Hrwr.ceeoeeEal(re
> adaeaclrmtrnbeTu)
>>pitHrwr.ceeoeeRaig)
> rn adaeaclrmtredn(
[.10000906,-.99996271,958016153]
0140005644 0109994323 .30008124

(iOS -> See pyobjus)
KIVY (4/5)
Kivy remote shell
Useful to try out or troubleshoot hardware-related functions

1. Install Remote Kivy App
2. SSH to a Python prompt
3. Poke around
$sh-80 amn121813
s p00 di@9.6..
amn121813spswr:#"iy
di@9.6..' asod
kv"
>>ipr pafr
> mot ltom
>>pafr.ahn(
> ltommcie)
'rvl
am7'
>>fo jisipr atcas
> rm nu mot uols
>>TxTSec =atcas'nri.pehtsTxTSec'
> etopeh
uols(adodsec.t.etopeh)
>>PtoAtvt =atcas'r.ep.nri.yhnciiy)
> yhnciiy
uols(ogrnyadodPtoAtvt'
>>ts=TxTSec(yhnciiymciiy Nn)
> t
etopehPtoAtvt.Atvt, oe
>>tssek'el Wrd' TxTSec.UU_LS,Nn)
> t.pa(Hlo ol., etopehQEEFUH oe
>>tssek'999999,TxTSec.UU_LS,Nn) #hh
> t.pa(999999' etopehQEEFUH oe
aa
KIVY (5/5)
More useful resources
1. Kivy Showcase

2. Kivy Catalog

3. InteractiveLauncher

4. irc.freenode.net
#kivy

http://www.youtube.com/watch?v=S2sFqFGDu1k
THAT'S ALL
References
http://python-for-android.readthedocs.org/en/latest/
http://kivy.org/docs/gettingstarted/intro.html
http://developer.android.com/tools/sdk/ndk/index.html
http://mdqinc.com/blog/2011/09/cross-compiling-python-for-android/
ACTUALLY...
I haven't been completely honest

Python App gets woken up by Java App
Java App stays alive to pass events through JNI

More Related Content

What's hot

DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!Umar Yusuf
 
GCE 上搭配 Cloud Storage 建置 Drone CI
 GCE 上搭配 Cloud Storage 建置 Drone CI GCE 上搭配 Cloud Storage 建置 Drone CI
GCE 上搭配 Cloud Storage 建置 Drone CIMING JUI Chen
 
Python in telecommunications (in 7 minutes)
Python in telecommunications (in 7 minutes)Python in telecommunications (in 7 minutes)
Python in telecommunications (in 7 minutes)iMasters
 
Continuous Delivery - FIT VUT
Continuous Delivery - FIT VUTContinuous Delivery - FIT VUT
Continuous Delivery - FIT VUTJuraj Michálek
 
C language in our world 2017
C language in our world 2017C language in our world 2017
C language in our world 2017Juraj Michálek
 
Ros with docker 20151107
Ros with docker  20151107Ros with docker  20151107
Ros with docker 20151107Sejin Park
 
Plugin For Unity
Plugin For UnityPlugin For Unity
Plugin For UnityDat Pham
 
Unity3D Plugins Development Guide
Unity3D Plugins Development GuideUnity3D Plugins Development Guide
Unity3D Plugins Development GuideKaiJung Chen
 
#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with DartGDGKuwaitGoogleDevel
 
Android v 1.1
Android v 1.1Android v 1.1
Android v 1.1Ravi Vyas
 
Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepChandramouli Biyyala
 
用 Go 語言實戰 Push Notification 服務
用 Go 語言實戰 Push Notification 服務用 Go 語言實戰 Push Notification 服務
用 Go 語言實戰 Push Notification 服務Bo-Yi Wu
 
Python games
Python gamesPython games
Python gamesmolw
 
Gorush: A push notification server written in Go
Gorush: A push notification server written in GoGorush: A push notification server written in Go
Gorush: A push notification server written in GoBo-Yi Wu
 
Cross-Platform App Development with Flutter, Xamarin, React Native
Cross-Platform App Development with Flutter, Xamarin, React NativeCross-Platform App Development with Flutter, Xamarin, React Native
Cross-Platform App Development with Flutter, Xamarin, React NativeKorhan Bircan
 
Google I/O 2018 Extended, Baghdad - Flutter
Google I/O 2018 Extended, Baghdad  - FlutterGoogle I/O 2018 Extended, Baghdad  - Flutter
Google I/O 2018 Extended, Baghdad - FlutterAbdElmomenKadhim
 
Development of Mobile Applications
Development of Mobile ApplicationsDevelopment of Mobile Applications
Development of Mobile ApplicationsDávid Kaya
 
Mp24: Python in gaming industry
Mp24: Python in gaming industryMp24: Python in gaming industry
Mp24: Python in gaming industryMontreal Python
 
Pythonistaの使い方
Pythonistaの使い方Pythonistaの使い方
Pythonistaの使い方Yusuke Muraoka
 

What's hot (20)

DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
 
GCE 上搭配 Cloud Storage 建置 Drone CI
 GCE 上搭配 Cloud Storage 建置 Drone CI GCE 上搭配 Cloud Storage 建置 Drone CI
GCE 上搭配 Cloud Storage 建置 Drone CI
 
Python in telecommunications (in 7 minutes)
Python in telecommunications (in 7 minutes)Python in telecommunications (in 7 minutes)
Python in telecommunications (in 7 minutes)
 
Continuous Delivery - FIT VUT
Continuous Delivery - FIT VUTContinuous Delivery - FIT VUT
Continuous Delivery - FIT VUT
 
C language in our world 2017
C language in our world 2017C language in our world 2017
C language in our world 2017
 
Flutter 1
Flutter 1Flutter 1
Flutter 1
 
Ros with docker 20151107
Ros with docker  20151107Ros with docker  20151107
Ros with docker 20151107
 
Plugin For Unity
Plugin For UnityPlugin For Unity
Plugin For Unity
 
Unity3D Plugins Development Guide
Unity3D Plugins Development GuideUnity3D Plugins Development Guide
Unity3D Plugins Development Guide
 
#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart
 
Android v 1.1
Android v 1.1Android v 1.1
Android v 1.1
 
Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by Step
 
用 Go 語言實戰 Push Notification 服務
用 Go 語言實戰 Push Notification 服務用 Go 語言實戰 Push Notification 服務
用 Go 語言實戰 Push Notification 服務
 
Python games
Python gamesPython games
Python games
 
Gorush: A push notification server written in Go
Gorush: A push notification server written in GoGorush: A push notification server written in Go
Gorush: A push notification server written in Go
 
Cross-Platform App Development with Flutter, Xamarin, React Native
Cross-Platform App Development with Flutter, Xamarin, React NativeCross-Platform App Development with Flutter, Xamarin, React Native
Cross-Platform App Development with Flutter, Xamarin, React Native
 
Google I/O 2018 Extended, Baghdad - Flutter
Google I/O 2018 Extended, Baghdad  - FlutterGoogle I/O 2018 Extended, Baghdad  - Flutter
Google I/O 2018 Extended, Baghdad - Flutter
 
Development of Mobile Applications
Development of Mobile ApplicationsDevelopment of Mobile Applications
Development of Mobile Applications
 
Mp24: Python in gaming industry
Mp24: Python in gaming industryMp24: Python in gaming industry
Mp24: Python in gaming industry
 
Pythonistaの使い方
Pythonistaの使い方Pythonistaの使い方
Pythonistaの使い方
 

Viewers also liked

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
 
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Andreas Jakl
 
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
 
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
 

Viewers also liked (6)

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
 
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
 
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)
 
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
 
Sem5 2016 (1)
Sem5 2016 (1)Sem5 2016 (1)
Sem5 2016 (1)
 

Similar to Standalone Android Apps in Python

Making a Headless Android Device (Oslo Embedded Meetup 2018)
Making a Headless Android Device (Oslo Embedded Meetup 2018)Making a Headless Android Device (Oslo Embedded Meetup 2018)
Making a Headless Android Device (Oslo Embedded Meetup 2018)Patricia Aas
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastBartosz Kosarzycki
 
PyQt Application Development On Maemo
PyQt Application Development On MaemoPyQt Application Development On Maemo
PyQt Application Development On Maemoachipa
 
MOBILE APP DEVELOPMENT USING PYTHON
MOBILE APP DEVELOPMENT USING PYTHONMOBILE APP DEVELOPMENT USING PYTHON
MOBILE APP DEVELOPMENT USING PYTHONPriyadharshiniVS
 
Making a Headless Android Device
Making a Headless Android DeviceMaking a Headless Android Device
Making a Headless Android DevicePatricia Aas
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Lars Vogel
 
Android presentation
Android presentationAndroid presentation
Android presentationImam Raza
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application DevelopmentRamesh Prasad
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidVlatko Kosturjak
 
The Ten (10) Best C/C++ Productivity Tools, Plugins and Libraries
The Ten (10) Best C/C++ Productivity Tools, Plugins and LibrariesThe Ten (10) Best C/C++ Productivity Tools, Plugins and Libraries
The Ten (10) Best C/C++ Productivity Tools, Plugins and Librarieslivecoding123
 
Native Mobile Application Using Open Source
Native Mobile Application Using Open SourceNative Mobile Application Using Open Source
Native Mobile Application Using Open SourceAxway Appcelerator
 
OSCON Titanium Tutorial
OSCON Titanium TutorialOSCON Titanium Tutorial
OSCON Titanium TutorialKevin Whinnery
 
Android overview
Android overviewAndroid overview
Android overviewHas Taiar
 
FusionInventory at LSM/RMLL 2012
FusionInventory at LSM/RMLL 2012FusionInventory at LSM/RMLL 2012
FusionInventory at LSM/RMLL 2012Nouh Walid
 
Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015Nilay Binjola
 

Similar to Standalone Android Apps in Python (20)

Making a Headless Android Device (Oslo Embedded Meetup 2018)
Making a Headless Android Device (Oslo Embedded Meetup 2018)Making a Headless Android Device (Oslo Embedded Meetup 2018)
Making a Headless Android Device (Oslo Embedded Meetup 2018)
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
 
PyQt Application Development On Maemo
PyQt Application Development On MaemoPyQt Application Development On Maemo
PyQt Application Development On Maemo
 
MOBILE APP DEVELOPMENT USING PYTHON
MOBILE APP DEVELOPMENT USING PYTHONMOBILE APP DEVELOPMENT USING PYTHON
MOBILE APP DEVELOPMENT USING PYTHON
 
Flask for cs students
Flask for cs studentsFlask for cs students
Flask for cs students
 
Making a Headless Android Device
Making a Headless Android DeviceMaking a Headless Android Device
Making a Headless Android Device
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
 
Android presentation
Android presentationAndroid presentation
Android presentation
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to Android
 
Alvaro Denis Resume
Alvaro Denis ResumeAlvaro Denis Resume
Alvaro Denis Resume
 
The Ten (10) Best C/C++ Productivity Tools, Plugins and Libraries
The Ten (10) Best C/C++ Productivity Tools, Plugins and LibrariesThe Ten (10) Best C/C++ Productivity Tools, Plugins and Libraries
The Ten (10) Best C/C++ Productivity Tools, Plugins and Libraries
 
Slideshare android
Slideshare androidSlideshare android
Slideshare android
 
Native Mobile Application Using Open Source
Native Mobile Application Using Open SourceNative Mobile Application Using Open Source
Native Mobile Application Using Open Source
 
OSCON Titanium Tutorial
OSCON Titanium TutorialOSCON Titanium Tutorial
OSCON Titanium Tutorial
 
Android overview
Android overviewAndroid overview
Android overview
 
FusionInventory at LSM/RMLL 2012
FusionInventory at LSM/RMLL 2012FusionInventory at LSM/RMLL 2012
FusionInventory at LSM/RMLL 2012
 
Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015
 

Recently uploaded

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 

Standalone Android Apps in Python

  • 1. STANDALONE ANDROID APPS IN PYTHON Baptiste Lagarde Sydney Python Group, 2013.11.07 I. Toolchain II. Kivy
  • 2. JAVA APP VS. PYTHON APP Python cross-compiled for ARM using the Android NDK Android NDK - The Native Development Kit allows you to implement parts of your app using native-code languages such as C and C++.
  • 5. TOOLCHAIN (2/5) Prerequisites ~6GB (sigh) Option A Download Android SDK + NDK Follow pages and pages of Google instructions Download more stuff from inside Eclipse (?!) Set-up some environment variables git clone ..., pip install ... Option B Download .vbi virtual machine image Run with virtualbox
  • 8. TOOLCHAIN (3/5) Cross-compilation Distribute kv@iyVrulo:/nri/yhnfradod .dsrbt.h- kv iykv-itaBx~adodpto-o-nri$ /itiues m iy 1. Creates a host Python 2. Compiles an ARM Python 3. Opt-in recipes with -m Modules Some Standard Library modules excluded by default to save space Pure python modules can simply be included with the app's code Many modules are available as "recipes"
  • 9. TOOLCHAIN (4/5) Make Kivy App Kivy - Open source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps. #ts.y etp ipr kv mot iy fo kv.p ipr Ap rm iyap mot p fo kv.i.utnipr Bto rm iyuxbto mot utn casTsApAp: ls etp(p) dfbidsl) e ul(ef: rtr Bto(et'el Wrd) eun utntx=Hlo ol' i _nm_ = '_an_: f _ae_ = _mi_' TsAp)rn) etp(.u( $pto ts.y yhn etp
  • 10. TOOLCHAIN (5/5) Build and Install Build $c ~adodpto-o-nri/itdfut d /nri/yhnfradodds/eal $.bidp -pcaecmeapemap-nm "yp"-vrin1-dr/aht/iyap /ul.y -akg o.xml.yp -ae MAp -eso -i pt/okv/p/ Install Phone: Settings > Developer options > USB debugging $abisalbnMAp1dbgak d ntl i/yp--eu.p ...or simply open the .apk on the phone (transfer by email, USB, Dropbox, ...)
  • 12. II. KIVY The KV language Accessing the hardware Useful resources
  • 13. KIVY (1/5) Example app (Saves the phone's accelerometer readings to CSV)
  • 14. KIVY (2/5) The KV Language Features Move UI declaration to separate file Root widget Templates Widget classes, inheritance Anything right of ":" is Python! Python imports Event bindings , e.g. on_press Keyword arguments Hooks, e.g. id, root, app, self Bxaot oLyu: oinain "etcl retto: vria" Lbl ae: i:ito d nr TxIpt etnu: i:pt d ah mliie Fle utln: as o_etvldt:apstah) ntx_aiae p.ept( Lbl ae: i:pors d rges Bxaot oLyu: oinain "oiotl retto: hrzna" Bto: utn tx:"tr cpue et Sat atr" o_rs:apsat) npes p.tr( Bto: utn tx:"tpcpue et So atr" o_rs:apso( npes p.tp) Bto: utn tx:"ut et Qi" o_rs:ei( npes xt)
  • 15. KIVY (3/5) Accessing the hardware with pyjnius pyjnius - Python module to access Java classes as Python classes, using JNI. JNI - The Java Native Interface is a programming framework that enables Java code running in a Java Virtual Machine to call, and to be called by, native applications and libraries written in other languages >>fo jisipr atcas > rm nu mot uols >>Hrwr =atcas'r.ep.nri.adae) > adae uols(ogrnyadodHrwr' >>Hrwr.ceeoeeEal(re > adaeaclrmtrnbeTu) >>pitHrwr.ceeoeeRaig) > rn adaeaclrmtredn( [.10000906,-.99996271,958016153] 0140005644 0109994323 .30008124 (iOS -> See pyobjus)
  • 16. KIVY (4/5) Kivy remote shell Useful to try out or troubleshoot hardware-related functions 1. Install Remote Kivy App 2. SSH to a Python prompt 3. Poke around $sh-80 amn121813 s p00 di@9.6.. amn121813spswr:#"iy di@9.6..' asod kv" >>ipr pafr > mot ltom >>pafr.ahn( > ltommcie) 'rvl am7' >>fo jisipr atcas > rm nu mot uols >>TxTSec =atcas'nri.pehtsTxTSec' > etopeh uols(adodsec.t.etopeh) >>PtoAtvt =atcas'r.ep.nri.yhnciiy) > yhnciiy uols(ogrnyadodPtoAtvt' >>ts=TxTSec(yhnciiymciiy Nn) > t etopehPtoAtvt.Atvt, oe >>tssek'el Wrd' TxTSec.UU_LS,Nn) > t.pa(Hlo ol., etopehQEEFUH oe >>tssek'999999,TxTSec.UU_LS,Nn) #hh > t.pa(999999' etopehQEEFUH oe aa
  • 17. KIVY (5/5) More useful resources 1. Kivy Showcase 2. Kivy Catalog 3. InteractiveLauncher 4. irc.freenode.net #kivy http://www.youtube.com/watch?v=S2sFqFGDu1k
  • 19. ACTUALLY... I haven't been completely honest Python App gets woken up by Java App Java App stays alive to pass events through JNI