Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - 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... 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 ... };; }; 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