delegating user tasks in applications
DESCRIPTION
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.TRANSCRIPT
![Page 1: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/1.jpg)
User Task Delegation in ApplicationsFriedger MüffkeOpenIntents.org
Campus Party 2012 Berlin
![Page 2: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/2.jpg)
Getting a 3-Months Job Done in 30 MinutesFriedger MüffkeOpenIntents.org
Campus Party 2012 Berlin
![Page 3: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/3.jpg)
Context
Task-driven software engineering
User taskInteraction design
Application platform with monolithic applications that perform user tasks
![Page 4: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/4.jpg)
History of Sharing between Application
Interprocess communication (IPC)
● Objects ○ Windows: DDE/COM○ J2EE: JavaBeans
● Functionality○ WebServices + UDDI○ RPC
● Graphical User Interface○ Dynvoker, TU Dresden (WS/GUI annotations)
![Page 5: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/5.jpg)
Problem Description
User Task Delegation is an architecture pattern designed to address the problem of a Component (Site/App) wanting to do a certain User Task (Action) with a Partner known to the User but not the Component.
![Page 6: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/6.jpg)
NASCAR problem
![Page 7: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/7.jpg)
Examples● Share
Twitter, Email,..
● PickPicasa, Flickr, Youtube, Webcam,..
● Editimage, document, ..
● SaveGoogle Drive, locally, ..
● PropsLike, praise, +1, ..
● PrintFax, pdf, ..
● LogInOpenId
● SubscribeNotifications by e-mail, sms, ..
● SearchWikipedia, dictionary, ..
● Check-in and other Activity Stream verbs
![Page 8: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/8.jpg)
Android: Intents
● Freely definable actions● Central repository in platform● Registration on install time● PackageManagerService class● No official discovery, but openintents.
org/en/registry
![Page 9: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/9.jpg)
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("http://campus-party.eu");context.startActivity(intent);
![Page 10: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/10.jpg)
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
![Page 11: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/11.jpg)
Web Apps: WebIntents/WebActivities
Available in Chrome Canary Build
![Page 12: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/12.jpg)
Web Apps: WebIntents/WebActivities
var startActivity = window.navigator.startActivity || window.navigator.webkitStartActivity;
var imageUrl = document.getElementById("main-image").src;
var intent = new Intent("http://webintents.org/share",
"image/*", imageUrl);
var onSuccess = function(data) { /* woot */ };var onError = function(data) { /* boooo */ };
startActivity.call(intent, onSuccess, onError);
![Page 13: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/13.jpg)
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
![Page 14: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/14.jpg)
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>
![Page 15: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/15.jpg)
Definition
User Task Delegation is an architecture pattern where semantically defined tasks are performed by third-party components.
1. Task definition 2. 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
![Page 16: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/16.jpg)
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
![Page 17: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/17.jpg)
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
https://github.com/openintents/gsoc2012/wiki
![Page 18: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/18.jpg)
Android Meets Web
![Page 19: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/19.jpg)
Questions ?
Friedger Müffkeopenintents.org
@fmdroidgplus.to/friedger
![Page 20: Delegating user tasks in applications](https://reader036.vdocuments.site/reader036/viewer/2022081401/5561efafd8b42aa5068b570b/html5/thumbnails/20.jpg)
Links
Android Intents
WebIntents SpecificationWebActivities
Windows 8 Contracts and Extensions