The Windows Phone app submission process is like “do it right or get out”. If you missed one of the certification requirements, you have to cope with an annoying delay until your app or update gets approved. In this article, I just want to give an overview of the failures I was facing at most.
Dark/light theme
If your app comes with a customized design (background image, font colors) that is different from one of those templates, you should take a look at your app after changing the phone from dark to light theme or vice versa. It may occur the situation that specific control labels or text elements cannot be read anymore.
As a solution I would suggest:
- Using pre-defined resource colors
- Use custom colors for EVERY control
- Switch the theme programmatically (Jeff Wilcox wrote a nice article about his tool, you can even use it with Windows Phone 8 )
The third resolution is my favorite one because you don’t have to care about the color problem in future updates when adding new controls. If you want to build an app that adjusts to the current color theme, I would suggest the first way.
512 MB Devices
With the upcoming of lower-memory devices, you should be careful when submitted a resource intense app. The certification requirements say the following:
“5.2.5: An app must not exceed 90 MB of RAM usage, except on devices that have more than 256 MB of memory. [...] 5.1.1: By default, the app is considered compatible with lower-memory devices. However, you can opt out of supporting lower-memory devices.”
So you have the option to opt out. I would not really consider this as a real option because Windows Phone gained a lot of new users with cheap low-memory devices. If you want your app to be successful, you should definitely support these type of devices.
The back button
Let’s at first hear what the requirements say:
“Pressing the Back button from the first screen of an app must close the app.”
That sounds simple, right? Yes, it is simple. But sometimes you get a loop when programmatically navigating between different pages. As a solution I would suggest:
- Using the NavigationService.GoBack() as much as possible instead of NavigationService.Navigate().
- If there’s still a loop, you can clear the back entries.
Clearing the back entries would look like this:
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
try
{
while (NavigationService.CanGoBack)
NavigationService.RemoveBackEntry();
}
catch (InvalidOperationException)
{
}
base.OnBackKeyPress(e);
}
Exception handling
Point 5.1.2 of the certification requirements says:
“The app must handle exceptions raised by the any of the managed or native System API and not close unexpectedly.”
That means if any exception occurs, your will not be approved. An advisable approach is definitely to implement a good exception handling. But sometimes errors still happen. If you don’t want your app to crash, you can react on unhandled exceptions with a global handler using App.xaml.cs.
Let’s say we add a custom exception handler:
</p>
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
if (Debugger.IsAttached)
{
// Eine nicht behandelte Ausnahme ist aufgetreten. Unterbrechen und Debugger öffnen
Debugger.Break();
}
GlobalExceptionHandler.Default.HandleException(sender, e);
}
In our exception handler we could display a message and create an email that can be sent to the developers of this app:
public void HandleException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
e.Handled = true;
var message = CoreResources.UnhandledExceptionMessageText;
var result = MessageBox.Show(message, CoreResources.UnhandledExceptionHeaderText, MessageBoxButton.OKCancel);
if (result == MessageBoxResult.OK)
{
var info = new ManifestAppInfo(); // Extracts information about the current app manifest
EmailComposeTask emailComposeTask = new EmailComposeTask();
emailComposeTask.To = "support@mycomany.com";
emailComposeTask.Subject = string.Format("{0} {1} Error Report", info.Title, info.Version);
string text = e.ExceptionObject.ToString();
emailComposeTask.Body = text;
emailComposeTask.Show();
}
There are also a lot of other requirements that may not be fulfilled, but these are the ones that were most annoying for me. I hope that helps you
Happy coding!


Trackbacks