Programming Mobile Apps With Python
Programming Mobile Apps With Python
Python
www.medando.de
Medando – Mobile Health Apps
• Everything else…
• Other systems, summary, conclusions
What is a smartphone?
• Combination of
• PDA functions, camera, media player, Web browser, …
• Equipped with
• Touch screen, high-speed networking (Wi-Fi, mobile
broadband), GPS, NFC, acceleration sensors, …
What is a Tablet?
• Android
• Apple iOS
• RIM BlackBerry
• Nokia OS / Symbian
• Samsung Bada
• …
Source: http://en.wikipedia.org/wiki/Smartphone
• Many more
• Cross-platform, manufacturer-specific,
carrier-specific, …
Source: http://en.wikipedia.org/wiki/App_Store_(iOS)
600.000
500.000
400.000
300.000
200.000
100.000
20.000.000.000
15.000.000.000
10.000.000.000
5.000.000.000
Source: http://www.windowsphoneapplist.com
• Symbian
• Window Mobile / CE
Symbian OS
S60
A schematic diagram of the S60 platform architecture.
• Stable Release
• Available on SourceForge
http://sourceforge.net/projects/pys60
import appuifw
appuifw.app.title = u„Hello World"
appuifw.note(u"Hello World!", 'info')
import appuifw
1. Importing modules import e32
Send SMS to someone if certain cell is near (using GSM Cell ID)
import location
home = 0
while home == 0:
country, provider, lac, cell = location.gsm_location()
if (cell== HOME_CELL_ID):
home = 1
message = u"Will be at home in a moment and %s" % mood
messaging.sms_send(WIFE, message)
http://tinyurl.com/pys60cube
Windows Mobile
• .NET framework
• Android
• iOS
• Windows Phone
Android
• some others
• Python!?
Several options
• Kivy
• PyGame
• Support for
• Python
• Perl
• Ruby
• Lua
• BeanShell
• JavaScript Source: Practical Android Projects by Lucas Jordan and Pieter Greyling
• Tcl
• Available on Google Code:
http://code.google.com/p/android-scripting
• Interactive console
• Scripts
• Sharing via barcodes or APKs
• Hello Word:
import android
droid = android.Android()
droid.makeToast('Hello, Android!')
• Used in SL4A
• Build files
• Open Source
• Website: http://kivy.org
class TestApp(App):
def build(self):
return Button(text='Hello World')
TestApp().run()
• Based on
• Python for Android (Py4A)
• Website: http://thp.io/2011/pyside-android/
def main():
from PySide.QtCore import *
from PySide.QtGui import *
app = QApplication(sys.argv)
w = QLabel('Hello World!')
w.show()
app.exec_()
if __name__=="__main__":
main()
iOS
Programming iOS
• Apps are written in Objective-C
http://pythonforios.com/
EuroPython 2012, Florence, 03.07.2012 Slide 45 www.medando.de
Python for iOS – On iPhone
• No dynamic linking
Windows Phone
IronPython
• No documentation yet
• http://blog.ironpython.net/2012/03/whats-new-in-ironpython-272.html
• Livescribe
• Amazon Kindle
• No Python support
Source: http://thp.io/2012/mobile-matrix/
EuroPython 2012, Florence, 03.07.2012 Slide 56 www.medando.de
Questions?
@onyame
Conclusions