ambienttalk, a scripting language for android devices - dries harnie, vub - droidcon.be 2011

16
AmbientTalk: A scripting language for Android devices Dries 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.

Upload: tcs-digital-world

Post on 28-Nov-2014

1.292 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

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.

Page 2: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

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

Page 3: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

Motivation

Tuesday 25 January 2011

As discussed by the panel.

Page 4: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

“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.

Page 5: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

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?

Page 6: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

Goal

Tuesday 25 January 2011

We want to write an app that allows people to collaborate on some task (ie. painting).

Page 7: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

AmbientTalk- Asynchronous

- Peer to peer

Tuesday 25 January 2011

AmbientTalk!Language designed to be robust against disconnections

Page 8: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

Async. communicationBuffer when other side is down

Tuesday 25 January 2011

Page 9: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

Discovery“Sniffing around”

for other devices

Tuesday 25 January 2011

Page 10: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 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.

Page 11: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

Portabilityissues:Multicast- Works in 1.0

- Broken in 1.5

- Fixed in 1.6

Tuesday 25 January 2011

Page 12: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

Portability issues:memory

AmbientTalk parser uses a lot of stack space

Many threads ... ++ungood.

Tuesday 25 January 2011

Page 13: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 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.

Page 14: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

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.

Page 15: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

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 ;)

Page 16: AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - droidcon.be 2011

Conclusion

http://ambienttalk.googlecode.com

@ambienttalk

Tuesday 25 January 2011