app to app communication in windows phone 8 - vtc 2014
TRANSCRIPT
![Page 1: App to App Communication in Windows Phone 8 - VTC 2014](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/1.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/2.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/3.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/4.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/5.jpg)
![Page 6: App to App Communication in Windows Phone 8 - VTC 2014](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/6.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/7.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/8.jpg)
One Handler
![Page 9: App to App Communication in Windows Phone 8 - VTC 2014](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/9.jpg)
No handlers
![Page 10: App to App Communication in Windows Phone 8 - VTC 2014](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/10.jpg)
2+ Handlers
![Page 11: App to App Communication in Windows Phone 8 - VTC 2014](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/11.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/12.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/13.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/14.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/15.jpg)
Receiving the File Launch Request
• Shared Storage and SharedStorageAccessManager.
![Page 16: App to App Communication in Windows Phone 8 - VTC 2014](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/16.jpg)
Launching the File
• Use Launcher.LaunchFileAsync method for launching a file.
![Page 17: App to App Communication in Windows Phone 8 - VTC 2014](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/17.jpg)
![Page 18: App to App Communication in Windows Phone 8 - VTC 2014](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/18.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/19.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/20.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/21.jpg)
![Page 22: App to App Communication in Windows Phone 8 - VTC 2014](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/22.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/23.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/24.jpg)
![Page 25: App to App Communication in Windows Phone 8 - VTC 2014](https://reader030.vdocument.in/reader030/viewer/2022032615/55a289e11a28abf4748b4739/html5/thumbnails/25.jpg)
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