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.
4. 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)
5. 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.
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. 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);
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
12. 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);
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. WP7 / Win 8: Contracts/Extensions
in 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. 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 components
3. Invocation by client component
4. Selection from registry by platform with help of user
5. Delivery to service
6. Response from serving component to client component
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. 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