Microsoft Introduces Playable Ads in Windows Apps

Microsoft Playable Ads is a new solution for Windows developers looking to draw more engaged users to their applications. The company recently launched Playable Ads, a type of in-app ad that allows potential users to experience a new app before installing it. Currently in preview, Microsoft Playable Ads allow customers to stream and interact with…

Answers to Your Burning Xbox Dev Questions

How do I protect my Xbox in dev mode? Can I publish my non-game app to Xbox One? Now that Microsoft is further opening up the Xbox platform to developers, you might have questions about either bringing an existing UWP app to Xbox, or developing directly for the gaming console. Microsoft’s recent live video training…

Free Xamarin, and Other Goodies for Developers From Build 2016

On Day Two of Build 2016, Microsoft made the announcement that developers have been hoping for since the company acquired Xamarin in February: Xamarin tools will now be free for all Visual Studio users. Subscribers to both paid and free tiers of Visual Studio will have access, which lowers considerably the cost of developing native apps…

An Easier Way to Access App Analytics

Tracking your app’s metrics—such as number of downloads and failure rate—is, of course, crucial to improving its performance. But the process can be cumbersome. Now, developers with apps in the Windows Store can access their analytics without having to log into Microsoft’s Dev Center, with a new Windows Store Analytics API. The API can be…

Windows Store Algorithm Updated to Improve App Visibility

Frustrated that your app doesn’t show up easily in Windows Store? Microsoft says it’s taking some steps to update the algorithm that decides which apps appear in search results. The algorithm “has been adjusted to give more weight to app quality signals such as the number of downloads and ratings,” according to a Microsoft blog post.…

WishAppList Tracks Demand for Windows 10 Apps

As Microsoft tries to encourage developers to build universal Windows apps, it’s suffered from what some observers have correctly called a chicken-or-the-egg problem: Developers don’t want to build until they know there’s user demand, but users may be shunning the platform until better apps are available. Now, a new website aims to open up communication…

How to Make Your App Visible in Windows Store

Windows Store has long been plagued with complaints about the low quality of apps, prevalence of spam, and the fact that popular apps are unavailable or missing key features. It’s a problem for Microsoft, which urgently wants to inspire more developers to build universal Windows apps. In its quest to improve the quality of apps…

Introducing Pic Me, an Exciting New Universal App for Windows

I’ve been working off and on for the last few months on a Windows app that I intend to publish soon in the Windows Store. Called “Pic Me,” the app sprang from a question my daughter asked me one night: “Dad, can you write an app that makes it easy to see all the photos I’ve been tagged in on Facebook and also lets me download those photos?” It sounded like a terrific idea, so I started laying down some code. I decided to make it a universal Windows app so it would run equally well on desktops, tablets, and phones. V1 is almost ready to submit for certification, so I thought I’d share it, source code and all, in case you’re interested in seeing how it’s put together and are interested in authoring universal apps of your own.

The screen shot below shows how Pic Me looks on a tablet and on a phone after I logged in using my Facebook credentials. (Try it yourself to see which photos you’ve been tagged in!) The login is accomplished using WinRT’s awesome WebAuthenticationBroker class, and if, after logging in, you want to log in as someone else to see what photos they’re tagged in, simply use the Switch User command in the command bar. On a phone, tap the ellipsis (the three dots) in the command bar to show the Switch User command, and on Windows, drag the command bar up from the bottom of the screen or display it by right-clicking on the screen or pressing Windows-Z on the keyboard.

Pic Me (1)

Both versions of the app – the Windows version and the Windows Phone version – use a grouped GridView control to show the photos you’re tagged in and the year in which the photos were posted. Among other things, this highlights the awesomeness of the fact that GridView is now supported in Windows and Windows Phone. I templated the controls slightly differently to optimize for the form factor, but it’s same basic code and XAML working in both instances. If you tap a photo on Windows, an enlarged version of the photo appears in an overlay; do the same on the phone, and you navigate to a page that shows a detail of the photo, complete with information about who posted it and when. If the photo is accompanied by a caption, a downward-pointing arrow will appear in the header, and you can tap it to view the caption.

Pic Me (2)

To save a photo to the local device, tap the Save button (the one with the disk icon) in the command bar. But you’re not limited to downloading one photo at a time; if you’d prefer, you can download all (or several) of them at once. Just go back to the main screen and select the photos you wish to download (see below). On a desktop or tablet, use a right-click or a vertical swiping motion to select a photo; on a phone, tap the Select button in the command bar to enter selection mode, and then tap each photo you wish to download. (On both platforms, you can use the Select All and Clear All buttons in the command bar to select or deselect photos en masse.) Once all the photos you want to download are selected, tap the Save button and all will be downloaded to the destination folder of your choice.

Pic Me (2)

Pic Me employs several interesting techniques and best practices for developers interested in learning to write universal apps. For one, it uses a novel code-sharing technique based on partial classes. The Windows project and the Windows Phone project each have a MainPage.xaml file and a MainPage.xaml.cs. But the shared project has a MainPage.xaml.cs, too. The shared MainPage.xaml.cs file contains code that is common to both apps, while the others contain code that is app-specific. I could have put everything in the shared MainPage.xaml.cs and #iffed the heck out of it to separate platform-specific code from shared code, but that seemed like a bad idea from a maintainability standpoint. So I leveraged C#’s support for partial classes and achieved a much cleaner code separation.

Another point of interest for developers is the app’s use of WebAuthenticationBroker, SaveFilePicker, and FolderPicker. These classes are implemented in WinRT in Windows and on the phone, but they work very differently on the two platforms. Specifically, brokers and pickers on the phone rely on a continuation pattern that means the app is deactivated (and possibly terminated) while a broker or picker is displayed. Jeffrey Richter blogged about this a while back and offered some cool helper classes to abstract the differences. Among other things, the continuation pattern means you’d better be serious about writing code to save and restore the state of the app in the event of suspension and termination, because if your app is indeed terminated while a broker or picker is displayed, the user is going to be pretty unhappy when the app is reactivated.

You can download the source code for Pic Me from my OneDrive. Be aware that the source code will probably change some as I do further testing and make last-minute tweaks, and I still need to come up with some unique imagery to brand the app. (When the final code is ready, I’ll refresh the download so you’ll have the latest and greatest bits.) Meanwhile, if you’re a developer, let me know if you find any bugs. I’ve spent quite a bit of time testing the edge cases (e.g., your Internet connection failing at just the wrong time, or an OAuth token expiring in the middle of a series of calls to Facebook’s cloud APIs) and working around quirks in the API (why in the world does WebAuthenticationBroker on Windows throw a FileNotFound exception if you fire it up without an Internet connection and click the Back button to back out of it?), but it’s always possible I’ve missed something, and I’d appreciate hearing about it if I did. I’m interested in usability feedback, too, although I should caution you that I’ve done extensive usability testing with two experts: my daughters!

Windows Store Apps Succinctly by John Garland – Get Your Free E-Book from Syncfusion

Windows Store apps present a radical shift in Windows development. They place content and interaction above all else to provide users with immersive, intuitive application experiences. With Windows Store Apps Succinctly by John Garland, you’ll be guided through obtaining a developer license, to managing your application’s life cycle and storage, all the way to submitting…