Partager via


Extending the Photos Hub for Windows Phone 8

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

This topic describes how your app can appear in the apps pivot page of the Photos Hub, a convenient launch point for photo-related apps. When your app is launched from the Photos Hub, no special information is sent in the URI; your app launches as though it were launched from the App list. For more information about other ways that you can extend the photos experience, see Photo extensibility for Windows Phone 8.

This topic contains the following sections.

Note

Many of the code examples shown in this topic are from the Photo Extensibility Sample.

Launching from the Photos Hub

The Photos Hub allows users to flip through their photos, browse their online albums, and catch up with their friends’ latest snapshots. There’s also an apps pivot page that’s dedicated to photo apps. When you extend the Photos Hub, your app can appear in this pivot page. The following image shows, from left to right, how to navigate to your app from the Photos Hub.

Note

The apps pivot page will not appear in the Photos Hub until you have at least one app installed that extends the Photos Hub.

Step 1: Register extensions

There’s only one step required to get your camera app to appear on the Photos Hub apps pivot page. Your app needs to register for the Photos_Extra_Hub extension. Extensions are specified in the WMAppManfiest.xml file. Just after the Tokens element, inside the Extensions element, the share picker extension is specified with the following Extension element.

<!-- Extend the Photos Hub and launch to default start page. -->
<Extension ExtensionName="Photos_Extra_Hub" 
           ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5632}" 
           TaskID="_default" />

The Windows Phone Manifest Designer does not support extensions; use the XML (Text) Editor to edit them. For more info, see How to modify the app manifest file for Windows Phone 8.

Testing Photos Hub extensibility

This procedure describes how you can launch your app from the Photos Hub. If you are testing on the Windows Phone 8 Emulator, you can skip the procedure for preparing your phone.

Note

When debugging Windows Phone OS 7.1 apps, keep in mind that relaunching your app will break the debugging process on your first app instance. Also, Emulator 7.1 does not support photo extensibility testing: that emulator doesn’t have the Photos Hub.

To prepare your phone for testing

  1. If you are testing extensibility with the Windows Phone 8 Emulator, you can skip this procedure and move on to the next one. If you are testing with your phone, continue with this procedure.

  2. Tether your phone to your computer and wait for it to be recognized.

  3. (This step is for Windows Phone OS 7.1 only) Run the WPConnect.exe tool as described in How to test apps that use the photo chooser or camera capture task for Windows Phone 8. This tool disconnects the Zune software from the media database on your phone. WPConnect.exe allows you to use the Photos Hub while your phone is tethered to your computer.

To test Photos Hub extensibility

  1. Select Debug from the menu, and select Start Debugging.

  2. After your app appears, tap Start to navigate to the Start screen.

  3. On the Start screen, tap the Photos app. This will open the Photos Hub.

  4. From the Photos Hub, swipe to the apps pivot page.

Note

The apps pivot page will appear in the Photos Hub only if one or more apps have declared the Photos Hub extension.

  1. On the apps pivot page, tap the name of your app. This will launch your app.

See Also

Other Resources

Photo extensibility for Windows Phone 8

Extending the photo apps picker for Windows Phone 7

Extending the share picker for Windows Phone 8