app to app communication in windows phone 8 - vtc 2014

25
App to App Communication in Windows Phone 8 Senthil Kumar Microsoft MVP – Client Development MobileOSGeek.com

Upload: senthil-kumar

Post on 12-Jul-2015

1.914 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: App to App Communication in Windows Phone 8 - VTC 2014

App to App Communication in Windows Phone 8

Senthil Kumar

Microsoft MVP – Client Development

MobileOSGeek.com

Page 2: App to App Communication in Windows Phone 8 - VTC 2014

About Me

• Work at Trivium eSolutions , Bangalore

• Microsoft MVP – Client Development

• Speaker , Blogger , Software Engineer.

• BDOTNETTER( Bangalore .NET User Group )

• Windows Phone enthusiast

Blog : MobileOSGeek.com

Twitter : @isenthil

Page 3: App to App Communication in Windows Phone 8 - VTC 2014

Agenda

• What is App to App Communication ?

• Introduction to File and Protocol Association

• Auto Launching with File Extension Association

• Auto Launching with Protocol Association

• Launching the Built-in Apps

• Demo

Page 4: App to App Communication in Windows Phone 8 - VTC 2014

What is App to App Communication ?

• Enables your application to communicate with another application.

• Enhance the user experience and easy solutions to apps providing services outside the app boundaries.

• App to App Communication via

– File Type Associations

– Protocol Associations

Page 5: App to App Communication in Windows Phone 8 - VTC 2014
Page 6: App to App Communication in Windows Phone 8 - VTC 2014

Auto-Launching with File Extension Association

• Allows to automatically launch the app when users tries to open a file of specified type.

• File Sources can be

– Email attachment

– Link on a Website

– Phone Browser

– NFC Tag

– Another App.

Page 7: App to App Communication in Windows Phone 8 - VTC 2014

User Experience with File and Protocol Associations

• On File or protocol launch request

– If there is only one app having corresponding file or protocol registration , the app will be launched automatically.

– If multiple apps are installed with registered file association , ths user is provided the choice on which app to launch

– If no apps is registered to handle the file or protocol , the user is offered the option of downloading one.

Page 8: App to App Communication in Windows Phone 8 - VTC 2014

One Handler

Page 9: App to App Communication in Windows Phone 8 - VTC 2014

No handlers

Page 10: App to App Communication in Windows Phone 8 - VTC 2014

2+ Handlers

Page 11: App to App Communication in Windows Phone 8 - VTC 2014

Auto-Launching with File Extension Association

• Registering a File Association

• Receiving a File Launch Request

– Detect a File Launch

– Retrieving a Launched File

• Launching a File

Page 12: App to App Communication in Windows Phone 8 - VTC 2014

Adding File Association to WMAppManifest.xml

• Add a FileTypeAssociation element inside Extensions element.

– Extensions element should follow immediately after Tokens element.

Page 13: App to App Communication in Windows Phone 8 - VTC 2014

Registering for File Association (Logos)

Logo Size Use Domensions

Small Email attachments 33X33 pixels

Medium Office Hub list view 69X69 pixels

Large Browser download 176X176 pixels

Page 14: App to App Communication in Windows Phone 8 - VTC 2014

File Launch Request

• On App Launch from the File Launch , a deep link URI is sent to the app

/FileTypeAssociation?fileToken=37dfc6ed-cdba-4424-9fa2-dba990a07486

• URI Mapper for Parsing deep link URI and mapping to the page in the App.

Page 15: App to App Communication in Windows Phone 8 - VTC 2014

Receiving the File Launch Request

• Shared Storage and SharedStorageAccessManager.

Page 16: App to App Communication in Windows Phone 8 - VTC 2014

Launching the File

• Use Launcher.LaunchFileAsync method for launching a file.

Page 17: App to App Communication in Windows Phone 8 - VTC 2014
Page 18: App to App Communication in Windows Phone 8 - VTC 2014

Protocol Associations

• Allows your app to automatically launch when another app launches a special URI

• The URI begins with a protocol name that your app has registered for

– For example , mobileosgeek is the protocol name in the below URI

– Mobileosgeek:ShowProducts?CategoryID=87411445-5451-419d-a2eb-79b39c8c552c

Page 19: App to App Communication in Windows Phone 8 - VTC 2014

Auto-Launching with Protocol Association

• Registering for Protocol Association

• Receiving Protocol Launch Request

– Detecting a Protocol Launch

• Launching a Protocol URI

• Reserved Protocol Names

Page 20: App to App Communication in Windows Phone 8 - VTC 2014

Registering for Protocol Association in WMAppManifest.xml

• To register for protocol association , add a Protocol element inside Extensions element.

– The Extensions element must follow immediately after the Tokens element.

Page 21: App to App Communication in Windows Phone 8 - VTC 2014
Page 22: App to App Communication in Windows Phone 8 - VTC 2014

Reserved Protocol Names

• Protocol Names reserved for Build-in Apps

– http , Tel , Onenote etc

• Protocol Names reserved for Operating System

– File , telnet etc.

Page 23: App to App Communication in Windows Phone 8 - VTC 2014

Launching Built-In Apps

• Launch some of the built-in apps using Uri schemes.

• Use Launcher.LaunchUriAsync method to launch the apps.

Eg : To launch the wifi settings app.

Page 24: App to App Communication in Windows Phone 8 - VTC 2014
Page 25: App to App Communication in Windows Phone 8 - VTC 2014

Resources

Building Apps for Windows Phone 8 Jump Start

http://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-Jump-Start

Matt Lacey's article on 325 Windows Phone apps you can launch from your own app

http://blog.mrlacey.co.uk/2014/03/325-windows-phone-apps-you-can-launch.html

Windows Phone 8 Training Kit

http://www.microsoft.com/en-in/download/details.aspx?id=38782