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

1,329 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,329
On SlideShare
0
From Embeds
0
Number of Embeds
113
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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

  1. 1. AmbientTalk: A scripting language for Android devices Dries HarnieTuesday 25 January 2011Hello everyone, my name is Dries Harnie and I’m here to present AmbientTalk: a scriptinglanguage for android devices.
  2. 2. The AmbientTalk Team Wolfgang De Meuter Tom Van Cutsem Stijn Mostinckx Elisa Gonzalez Boix Dries Harnie Andoni Lombide Christophe Scholliers Eline Phillips Kevin Pinte Lode HosteTuesday 25 January 2011We are AmbientTalk. Resistance is futile.Look for us with the ambientTalk tshirts
  3. 3. MotivationTuesday 25 January 2011As discussed by the panel.
  4. 4. “Put everything in the cloud” What is wrong with this picture?Tuesday 25 January 2011cloud 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 itover a slow connection.
  5. 5. A very cool cloud app.Tuesday 25 January 2011This 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, savingbandwidth.This is something we should embrace in ALL applications: why go via the cloud if you can doit directly?
  6. 6. GoalTuesday 25 January 2011We want to write an app that allows people to collaborate on some task (ie. painting).
  7. 7. AmbientTalk - Asynchronous - Peer to peerTuesday 25 January 2011AmbientTalk!Language designed to be robust against disconnections
  8. 8. Async. communication Buffer when other side is downTuesday 25 January 2011
  9. 9. Discovery “Sniffing around” for other devicesTuesday 25 January 2011
  10. 10. Deployment on real devicesTuesday 25 January 2011Because 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 raninto all sorts of issues.iPhone .. no real java supportFinally android, but not without issues.
  11. 11. Portability issues: ✉ ✓ Multicast ✓ - Works in 1.0 - Broken in 1.5 ✗ - Fixed in 1.6Tuesday 25 January 2011
  12. 12. Portability issues: memory AmbientTalk parser uses a lot of stack space Many threads ... ++ungood.Tuesday 25 January 2011
  13. 13. 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 2011When transferring objects from/to android, make sure the serialVersionUid fields match.These are usually computed, but dalvik and sun jvms do it differently.
  14. 14. The proof of the pudding... http://youtu.be/k0HYqRCxtHcTuesday 25 January 2011this 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.
  15. 15. import /.demo.weScribble deftype Painter; def remoteInterface := object: { def touchStart(other, x, y, color) { def otherPainters := []; ... drawing stuff ... }; whenever: Painter discovered: { |ref| def touchEnd(other, x, y) { Android.Log.v("Fingerpaint", ... drawing stuff ... "Discovered other painter:" + ref); }; otherPainters := otherPainters + [ref]; def erase() { }; ... drawing stuff ... }; network.online; }; export: remoteInterface as: Painter;Tuesday 25 January 2011I’ll even show you the code!Look, an import statement ;)
  16. 16. Conclusion @ambienttalk http://ambienttalk.googlecode.comTuesday 25 January 2011

×