Delegating user tasks in applications


Published on

The slides introduce the concept of delegating user tasks in applications through messaging and app resolution of the application platform. The concept was implemented in the first version of the Android platform as is now becoming popular on other platforms as well. The W3C is discussing a draft for web intents, Mozilla proposed a document about web activities and windows provides contracts for certain user tasks.

The most popular task is "sharing". The user has a huge selection of available services from social medias, to email, from printing services to online storage. No application can ever implement all possibilities. Therefore, the application framework provides a selection of the user's preferred services. The different approaches are compared and code examples are given.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Delegating user tasks in applications

  1. 1. User TaskDelegation inApplicationsFriedger MüffkeOpenIntents.orgCampus Party 2012 Berlin
  2. 2. Getting a 3-Months JobDone in 30MinutesFriedger MüffkeOpenIntents.orgCampus Party 2012 Berlin
  3. 3. ContextTask-driven software engineeringUser taskInteraction designApplication platform with monolithicapplications that perform user tasks
  4. 4. History ofSharing between ApplicationInterprocess communication (IPC)● Objects ○ Windows: DDE/COM ○ J2EE: JavaBeans● Functionality ○ WebServices + UDDI ○ RPC● Graphical User Interface ○ Dynvoker, TU Dresden (WS/GUI annotations)
  5. 5. Problem DescriptionUser Task Delegation is an architecturepattern designed to address the problem of aComponent (Site/App) wanting to do a certainUser Task (Action) with a Partner known to theUser but not the Component.
  6. 6. NASCAR problem
  7. 7. Examples● Share ● LogIn Twitter, Email,.. OpenId● Pick ● Subscribe Picasa, Flickr, Youtube, Webcam,.. Notifications by e-mail, sms, ..● Edit ● Search image, document, .. Wikipedia, dictionary, ..● Save ● Check-in and other Google Drive, locally, .. Activity Stream● Props verbs Like, praise, +1, ..● Print Fax, pdf, ..
  8. 8. Android: Intents● Freely definable actions● Central repository in platform● Registration on install time● PackageManagerService class● No official discovery, but openintents. org/en/registry
  9. 9. Android: Intents in Manifest.xml <intent-filter> <action android:name= "android.intent.VIEW"/> <data android:scheme = "http"/> </intent-filter> in Application Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(""); context.startActivity(intent);
  10. 10. Web Apps: WebIntents/WebActivities● Specified as W3C draft and Mozilla proposal● User agent manages registry● Registration on visit or programmatically● Suggestions via Chrome Web Store● discovery maybe via openintents. org/en/registry
  11. 11. Web Apps: WebIntents/WebActivities Available in Chrome Canary Build
  12. 12. Web Apps: WebIntents/WebActivitiesvar startActivity = window.navigator.startActivity || window.navigator.webkitStartActivity;var imageUrl = document.getElementById("main-image").src;var intent = new Intent("", "image/*", imageUrl);var onSuccess = function(data) { /* woot */ };var onError = function(data) { /* boooo */ };, onSuccess, onError);
  13. 13. WP7 / Win 8: Contracts/Extensions● Defined by platform● More specific tasks (e.g. account picture)● Agreement between two apps or between app and Windows● Different API (code) for each user task● Declarative registration for serving apps● Event handlers● No discovery
  14. 14. WP7 / Win 8: Contracts/Extensionsin client app (sharing)var dataTransferManager = Windows.ApplicationModel.DataTransfer. DataTransferManager.getForCurrentView();dataTransferManager.addEventListener("datarequested", function (e) { // Code to handle event goes here. });in serving app (file picker)<Extension Category="windows.fileOpenPicker" StartPage="fileOpenPicker.html"> <FileOpenPicker> <SupportedFileTypes> <SupportsAnyFileType /> </SupportedFileTypes> </FileOpenPicker>
  15. 15. DefinitionUser Task Delegation is an architecturepattern where semantically defined tasks areperformed by third-party components.1. Task definition2. Registration of serving components3. Invocation by client component4. Selection from registry by platform with help of user5. Delivery to service6. Response from serving component to client component
  16. 16. Further topics● Discovery for developers and users● Dependency Management● Implicit vs. explicit delegation● Delegation architecture vs. trusted subsystem● Data flow and security/privacy● Remote Delegation (e.g. PLAY_TO)● Between Native and Web
  17. 17. Android Meets WebIntents● Google Summer of Code 2012 project● Cheng Zheng, mentored by OpenIntents● Deliverables: ○ User agent with registry and native app integration ○ Helper lib for extended chooser dialog ○ Sample app
  18. 18. Android Meets Web
  19. 19. Questions ? Friedger Müffke @fmdroid
  20. 20. LinksAndroid IntentsWebIntents SpecificationWebActivitiesWindows 8 Contracts and Extensions