AmbientTalk:A scripting languagefor Android devicesDries Harnie
Tuesday 25 January 2011
Hello everyone, my name is Dries Harnie and I’m here to present AmbientTalk: a scripting language for android devices.
The AmbientTalk Team
Stijn Mostinckx Elisa Gonzalez Boix
Andoni Lombide Christophe Scholliers
Tom Van CutsemWolfgang De Meuter
Kevin Pinte
Dries Harnie
Eline Phillips Lode Hoste
Tuesday 25 January 2011
We are AmbientTalk. Resistance is futile.Look for us with the ambientTalk tshirts
Motivation
Tuesday 25 January 2011
As discussed by the panel.
“Put everything in the cloud”What is wrong with this picture?
Tuesday 25 January 2011
cloud printing.Who here has ever printed when he was not in walking range of a printer?You want to walk up to a printer and say “print this”, not find it in a cloud and then print to it over a slow connection.
A very cool cloud app.
Tuesday 25 January 2011
This is a service I joined recently.They allow you to store files in the cloud.However, they do things differently.If you have two devices on the same network, they will communicate directly, saving bandwidth.This is something we should embrace in ALL applications: why go via the cloud if you can do it directly?
Goal
Tuesday 25 January 2011
We want to write an app that allows people to collaborate on some task (ie. painting).
AmbientTalk- Asynchronous
- Peer to peer
Tuesday 25 January 2011
AmbientTalk!Language designed to be robust against disconnections
Async. communicationBuffer when other side is down
Tuesday 25 January 2011
Discovery“Sniffing around”
for other devices
Tuesday 25 January 2011
Deployment on real devices
Tuesday 25 January 2011
Because we wrote the AT interpreter in Java it runs unmodified on all desktop platforms.We managed to squeeze it onto HTC Touch Cruise phones running the IBM J9 VM, but we ran into all sorts of issues.iPhone .. no real java supportFinally android, but not without issues.
Portabilityissues:Multicast- Works in 1.0
- Broken in 1.5
- Fixed in 1.6
✓
✓
✗
✉
Tuesday 25 January 2011
Portability issues:memory
AmbientTalk parser uses a lot of stack space
Many threads ... ++ungood.
Tuesday 25 January 2011
Portability issues: serialization
ClassCastException: serialVersionUid doesn’t match
Three different classloaders
A) ClassLoader.getSystemClassLoader()
B) Thread.setContextClassLoader()
C) Foo.class.getClassLoader() # This is the only one that knows about your classes.
Tuesday 25 January 2011
When transferring objects from/to android, make sure the serialVersionUid fields match.These are usually computed, but dalvik and sun jvms do it differently.
The proof of the pudding...
http://youtu.be/k0HYqRCxtHc
Tuesday 25 January 2011
this is a demo we made yesterday.I wrote the app in four hours.~ 90 lines of ambienttalk, of which only 20 networking.400 lines of java. mostly stolen from api demo.
import /.demo.weScribbledeftype Painter;
def otherPainters := [];
whenever: Painter discovered: { |ref| Android.Log.v("Fingerpaint",
"Discovered other painter:" + ref); otherPainters := otherPainters + [ref];};
network.online;
def remoteInterface := object: { def touchStart(other, x, y, color) { ... drawing stuff ... }; def touchEnd(other, x, y) { ... drawing stuff ... }; def erase() { ... drawing stuff ... };};
export: remoteInterface as: Painter;
Tuesday 25 January 2011
I’ll even show you the code!Look, an import statement ;)
Conclusion
http://ambienttalk.googlecode.com
@ambienttalk
Tuesday 25 January 2011
Top Related