Do you like my apps?

The title might be a little misleading but what I want to show here is how you can see if a user has more then one app on his Windows Phone. But before we dig into the code let us first answer the question...

Why would you want to know this?

I can think of quite a few reasons why checking if a user has some of your apps already installed but one of the biggest reasons is - app promotion.

Runtastic does a great job with this. They have several apps for Windows Phone and they promote them in each of their installed apps by giving the user a list of apps built by the Runtastic team which they can download. Any app already on your phone won't be displayed.

Another reason could be to offer users some other things like power-ups or hidden perks if they have some other of your apps installed. This could come in handy in games.

There are probably many more reasons but I think it's time now to...

Dig into the code!

What you need are just two lines of code (and some braces).

var packages = InstallationManager.FindPackagesForCurrentPublisher();

foreach (Package package in packages)
{
  //Do your magic here :)         
}

Now that was easy! I know this isn't probably something that will make you feel like you're on top of the world but it can help you see how your users react to your apps and which apps are used more then the rest.

You can have a closer look here. I hope that this helped at least some of you :)

Until next time, happy coding!

 

IntelliSense not working

Windows Phone progress indicator