31 Days of Windows Phone | Day #22: Apps vs. Games

This post is Day #22 in a series called the 31 Days of Windows Phone.

Yesterday, I posted an epic-length article on the Silverlight Toolkit for Windows Phone.  Today will be a bit shorter, but just as valuable.  We’re going to cover a subtle but important designation in your application’s settings:  the Genre.

If you have created a default Windows Phone application (or a default XNA application), and deployed it to the emulator, you’ve probably noticed that it resides in the primary list of applications. (The list you see when you tap on the arrow on the home screen.)

If you’ve used an actual WP7 device, however, you’ve probably noticed that all of the games show up in the Games hub.  There’s a very simple way to make this happen, though your application will seem to “disappear” in the emulator when you do this.  Keep in mind that you should ONLY do this if your application is ACTUALLY a game.  You might get denied from the App Hub if you aren’t honest about what your application is.

Remember Day #1?

On Day #1 of this series, I walked through each file of a default Silverlight application for Windows Phone.  To make this little switch, all we need to do is open the WMAppManifest.xml document.  Take a look at your Solution Explorer in Visual Studio 2010 to find it.  It’s in the Properties folder.

 solutionexplorer

Inside this file, you’ll find a bunch of metadata about your application.  Specific things like the name/path of your Application icons, application names, default page to load, etc.

As an aside, changing the DefaultTask’s NavigationPage property is a great way to speed up the manual testing of your UI.  Change the name of the page in that node, and your app will load on the new page instead.  Here’s an example:

<Tasks>
    <DefaultTask  Name ="_default" NavigationPage="ProductPage.xaml?id=42"/>
</Tasks>

OK, back to the task at hand…getting our application to reside in the Games hub instead of being treated like every other application on the phone.  To do this, we need to modify the Genre property of the App node of this document.  Here’s what it looks like by default (I’ve moved things around so that you can see the Genre value without scrolling):

<App xmlns="" Genre="apps.normal" ProductID="{8743bc4b-a909-4512-aab9-8633d93a5b04}" Title="Day22_AppsVsGames" RuntimeType="Silverlight" Version="1.0.0.0" Author="Jeff Blankenburg" Description="An amazing demo on how to change your app's location." Publisher="Blankensoft">

You can see that the default value for Genre is “apps.normal.”  Change that value to “apps.games” and you’ll notice that your application vanishes from the emulator.  (It’s not actually gone, you just don’t see the Games hub in the emulator.  Here’s my example, modified with this change:

<App xmlns="" Genre="apps.games" ProductID="{8743bc4b-a909-4512-aab9-8633d93a5b04}" Title="Day22_AppsVsGames" RuntimeType="Silverlight" Version="1.0.0.0" Author="Jeff Blankenburg" Description="An amazing demo on how to change your app's location." Publisher="Blankensoft">

If you get an opportunity to deploy your application to an actual device, however, you’ll find your game in the Games hub.  In the United States, that means you can try this as soon as November 8th.  If you’re in New Zealand, however, you can already acquire one.

In order to make this happen, however, make sure to also get registered in the App Hub.  Until you have a developer account there, you won’t be able to push your code to your own phone.

Download the Code

There’s really not much more to this sample code than I wrote about above, but you can download it nonetheless.  Enjoy!

download

9 thoughts on “31 Days of Windows Phone | Day #22: Apps vs. Games

  1. This post is Day #22 in a series called the 31 Days of Windows Phone. Yesterday, I posted an epic-length article on the Silverlight Toolkit for Windows Phone.   Today will be a bit shorter, but just as valuable.

  2. Valuable information! Looking forward to seeing your notes posted.

  3. The whole aim of practical politics is to keep the populace in a continual state of alarm (and hence clamorous to be led to safety) by menacing them with an endless series of hobgoblins, all of them imaginary.

  4. True love is like ghosts, which everybody talks about and few have seen.

  5. Here at lastWe shall be freethe Almighty hath not builtHere for his envy, will not drive us henceHere we may reign secure, and in my choiceTo reign is worth ambition though in HellBetter to reign in Hell, than serve in Heaven.

  6. You see things as they are and ask, 'Why' I dream things as they never were and ask, 'Why not'

  7. hi, i was reading 31 days of windows phone, but i coudnt find all the 31 daays (there is day1, day 2, and then is like day 22).
    Other thing, I just wanted know if is worthed reading 31 days of windos phone or is better just go to 31 days of mango.

    Thanx :)

  8. “31 Days of Windows Phone | Day #22: Apps
    vs. Games

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s