Adam Benoit

Windows Phone Development

Detecting Kid’s Corner in Windows Phone 8

Posted on

by Adam

The other day I had an idea. My daughter loves kittens. And really, what kid doesn’t? I realized that if I created an app that only showed picture of kittens, she would be distracted when necessary.

The problem is I have created a monster! Once I hand over my phone, she doesn’t want to give it up. Turns out, this was a really great app idea. Once I added some live tiles with a secondary tile, I was set to release.

During my testing, I encountered a problem when using my app in the Windows Phone 8 emulator. Turns out, secondary tiles can not pinned to the Kid’s Corner interface. Trying to pin it caused a message bot to appear that said “When you’re in Kid’s corner, you can’t change what’s pinned to start.”. This would be a bad thing for a child to encounter when using my app.

After looking through the documentation, I could not find any answers myself so I posed the question on Stack Overflow and Twitter looking for answers. After a few hours, I was given the answer I was hoping for by Matthijs Hoekstra, a Developer Evangelist at Microsoft Netherlands.

His answer is as simple as it useful:

In the Windows.Phone.ApplicationModel Namespace, there is a class called ApplicationProfile that contains a static property called “Modes”. Querying this property will return one of the 2 following a ApplicationProfileModes enum objects:

  1. Default
    1. The App is running in the normal area of the phone
  2. Alternate
    1. The App is running in Kid’s Corner

So back to my Kittens For Kids app. I could easily have hidden the secondary tile menu item from view when running in Kid’s Corner but decided that hiding the menu entirely would be a better option so I used the following code:

if (ApplicationProfile.Modes == ApplicationProfileModes.Default)
{
    CreateApplicationBar();
}

Now the menu only appears to the parent and not the kid. I see this opening up the possibility for writing apps that contain settings and options that the parent can set, that the kid cannot change.

Because of this newly found ability, I foresee me writing apps that cater specifically to kids in the kids zone. In my opinion, this looks to be a huge untapped market for apps made specifically for kids in the Kid’s Corner.

About Adam

Adam Benoit is a Quality Assurance Analyst, Contributing Author and Windows Phone Developer. View all posts by Adam →
This entry was posted in Development, Featured, Howto. Bookmark the permalink.

Comments are closed.