python for android
TRANSCRIPT
Python for AndroidRyan [email protected]
3ca.org.uk
Why Python?
Easy to learn and use
Huge range of mature libraries
Runs on many platforms
3ca.org.uk
Eggstensive applications
Well developed and supported application eco-system
Packaging, namespacing and distribution have improved greatlybetter componentisation
easier to integrate disparate code
easier to build on existing packages
3ca.org.uk
Running on bare metal
Cython has grown out of Pyrex
Provides simple way to wrap pre-existing C libraries
Allows python developers to use C typing for variables, and optimize resource-intensive code
3ca.org.uk
Excellent support for crypto libraries
Python applications have good security track record
Great tools for testing
Easy to read and document
Many eyes make all bugs shallow...if they can understand the code
You can trust a comedy snake
3ca.org.uk
Aspect orientation
Lightweight adaptable components rather than objects bloated by multiple inheritance
Provided in python by zope.interface (and zope.component)
Encourages code re-usability and cross-pollination between projects and code bases
3ca.org.uk
Why Python (...and not Java)?
Python is free (...from Oracle!)
Python is fun for developers
Python is cool for kids!
3ca.org.uk
Cooking your apps
Several alternatives:Android Scripting Engine
Py4a
python-for-android
python-for-android compiles into native code which is packaged into standalone APKs
zc.buildout recipe to install Android NDK/SDK:bit.recipe.python_for_android
3ca.org.uk
Twisted matrix
Asynchronous event-driven socket framework for abstracting network protocols
Server and client support for most major protocols known to free standards
HTTP, XMPP, IRC, XML-RPC, SOAP, SIP, DNS, IMAP, SMTP etc, etc...
Great for stateful protocols such as web sockets
3ca.org.uk
On my own little cloud
What do I want from my device?do the things that I can't (be bothered to) do
work for me
understand each other
Free Software and Open Standards
Angelic daemons
3ca.org.uk
Thinking inside the box
How do I want to interact with my device?
Bots are more fun than terminalsUnpredictable
Adaptive
Better at arithmetic/chess/jeopardy than me
The veil of intelligence
3ca.org.uk
Singing strings
Android has built in text-to-speech system
FOSS has good speech synthesis stackFestival/Espeak
FOSS voice recognition less well developedCMU-Sphinx/MARF
Voice recognition possible through proprietary integration
3ca.org.uk
A question of semantics
AIML provides simple lexical parser
NLTK for more sophisticated language processing
OpenCog and other projects aimed at developing cognition engines
I want my bot to be wiser than the bloke in the pub or troll on IRC, even if it can't pass the Turing test
3ca.org.uk
Thinking with eyes and hands
Props to Bruno Latour and Mercator for drawing things together
Information gains power through ...objects which have the properties of being mobile but also immutable, presentable, readable and combinable with one another
Python provides contemporary power tools
3ca.org.uk
Natural user interfaces
OpenGL enables 3d interactive surfaces
Exploit Android sensor data to respond to user activity or environment
Utilise device as control interface to external applications or devices
Sensory augmentation, telepathy, and astral projection
Thinking without eyes or hands
3ca.org.uk
The Kivy abstraction
Cross-platform game and NUI toolkit
Exploit GPU acceleration
Utilise multi-touch surfaces and sensors
Apart from games, also used for:Programmable controllers
Education tools
Signage
Installations
3ca.org.uk
The road to good intention...
Access to Android APIs and intents provided through JNI bridge wrapped in Cython
API coverage is currently limited
Growing developer community
Contributions welcome:
http://github.com/kivy/python-for-android
3ca.org.uk
All puns indented...
3ca.org.uk
Ryan Northey
3ca.org.uk