App to App Communication in Windows Phone 8 - VTC 2014

Post on 12-Jul-2015

1,912 views 1 download

transcript

App to App Communication in Windows Phone 8

Senthil Kumar

Microsoft MVP – Client Development

MobileOSGeek.com

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

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

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

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.

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.

One Handler

No handlers

2+ Handlers

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

Adding File Association to WMAppManifest.xml

• Add a FileTypeAssociation element inside Extensions element.

– Extensions element should follow immediately after Tokens element.

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

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.

Receiving the File Launch Request

• Shared Storage and SharedStorageAccessManager.

Launching the File

• Use Launcher.LaunchFileAsync method for launching a file.

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

Auto-Launching with Protocol Association

• Registering for Protocol Association

• Receiving Protocol Launch Request

– Detecting a Protocol Launch

• Launching a Protocol URI

• Reserved Protocol Names

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.

Reserved Protocol Names

• Protocol Names reserved for Build-in Apps

– http , Tel , Onenote etc

• Protocol Names reserved for Operating System

– File , telnet etc.

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.

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