Intercepting and Overriding the Back Button in Windows Phone 8 Apps

If you want to prevent the default action happening when a user presses the back button on a Windows Phone you can override the OnBackKeyPress method in your page. To prevent the default back behaviour (e.g. navigating to the previous app page) you can set the Cancel property of the CancelEventArgs to true.

The following code shows how to prevent the back button from navigating to the previous page if a UI element called “ShareChoices” is visible:

protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
    if (ShareChoices.Visibility == Visibility.Visible)
    {
        HideShareChoices();
        e.Cancel = true;
    }
}

When deciding to override (and cancel) the default back button behaviour, be sure that it’s sensible and intuitive to the user. Incorrect use may result in certification failure.

One use that I’ve seen is in data entry apps. On the main page, the back is intercepted and if there are unsaved data entry changes an “are you sure” dialog is displayed. You shouldn’t do this “are you sure you want to exit app” on apps where there is no loss of data if a user exits. In these cases this kind of “exit prompt” will be annoying and pointless to the user.

SHARE:

Microsoft Buys Part of Nokia

So the big news of the moment is that Nokia is selling it’s Devices & Services business to Microsoft.

The deal is “expected to close in the first quarter of 2014, subject to approval by Nokia shareholders, regulatory approvals and other customary closing conditions”.

After the deal has taken place (according to the press release) Nokia will focus on network infrastructure, mapping and location services and “Advanced Technologies”.

After the deal closes, it will mean about 32,000 people will transfer to Microsoft which includes about 4,700 people in Finland. Microsoft will own “all Nokia Devices & Services production facilities”.

Microsoft will also get a 10 year non-exclusive license to Nokia patents.

More...

SHARE:

Quick-Start Guide To Using xUnit To Test Your Windows 8 WinRT Store app

Until xUnit officially supports* Windows store apps you can get xUnit working with your WinRT app by doing the following:

In Visual Studio 2012, go to Tools menu, Extensions and Updates; search for and install “xUnit.net runner for Visual Studio 2012”.

xUnitRunner

In Visual Studio 2012, go to Tools menu, Extensions and Updates; search for and install “xUnit Test Library Template”.

xUnitTemplate

You may have to restart Visual Studio…

More...

SHARE:

The Complete Beginners Guide to using SQLite SQL database in a Windows 8 App

[Writing this on the train home so may be a bit rushed – sorry :) ]

Install the Bits

  1. In Visual Studio 2012, go to Tools menu, Extensions and updates.
  2. Search for “SQLite for Windows Runtime” – install it.
  3. In your Windows Store app, install the NuGet package called “sqlite-net” – these are the LINQy wrappers over SQLite.

Use SQLite

Create an “entity” that you want to store in a table, e.g. Customer.

Create some plain properties, choose one to be your primary key, e.g.

[SQLite.PrimaryKey, SQLite.AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }

 

Create a constant to be the filename of the SQLite db on disk:

private const string dbFileName = "data.dat";

More...

SHARE:

The Enterprise Re-Imagined with Windows 8

If your company is currently in the process of upgrading to Windows 8, do they see it as a simple OS upgrade to keep up to date; or, do they see it as an enabler to re-imagine how the business operates?

Windows 8 offers the potential to streamline business processes, lower costs, and offer additional customer service opportunities

With an internal app store, domain-joined tablet PCs and innovative leadership, Windows 8 can offer the potential to streamline business processes, lower costs, and offer additional customer service opportunities.

Multiple Internal Apps

Refactoring Legacy Applications

Most companies without excellent software development practices and management end up with big, kitchen-sink. costly-to-maintain software systems.

Internal-facing corporate Windows 8 apps offer a solution to this problem.

More...

SHARE:

Getting Ready to Build Your First Windows 8 App

This article outlines an approach to getting started building you first Windows 8 app, but rather than focus on the technology aspects it focus on the pre-coding activities.

The Idea

So you have a few ideas for your first app, but how do you decide which one to build? It depends on what you want to get out of it. If you want to use your first app as a learning experience or to get some app building experience on your CV then you may not be concerned with monetisation.

Monetising you App

If you are attempting app building as a means of income generation then you’ll want to consider what monetisation options Windows 8 gives you:

  1. Paid app
  2. Free app with adverts
  3. In-app purchases*

*You can also use in-app purchases with paid or free apps and with or without ads.

Regardless of app type, you should offer a version of the app without ads for those people who really dislike them.

The Appeal Spectrum

One way of deciding which app idea to build is to think of its potential appeal. If you imagine this appeal as a spectrum from widest appeal (think Facebook, Twitter, etc.) to those with limited appeal (specialist niche apps, etc.).

On top of this spectrum we can add some potential income factors: will millions of people pay hundreds of dollars for the app, or will millions of people pay a dollar for the app?

More...

SHARE:

What I Learned Building My First 4 Windows 8 Apps

This is a bit of a brain-dump, in no particular order, of things I learned building my first 4 Windows 8 (C# XAML) apps:

- Countdown To

- Big Screen Countdown

- BizBuzBingo

- Code Retreat Countdown

Adding Microsoft Ads to your App

  1. Sign up here: PubCenter
  2. Create a Windows 8 Ad Unit (note the different ad sizes)
  3. Install the Advertising SDK
  4. Add a reference to the ad assembly
  5. Ads the AdControl to your XAML, set the application ID and Ad Unit Id properties to those specified in you ad unit in PubCenter (for testing ads before publication see this DZone article)
  6. Ensure your ad unit control has it’s width and height set to that of your ad unit
  7. Ensure that the app capabilities have Internet enabled (otherwise you wont see any ads show up).

Certification Failure when your App has internet capability

If you app is capable of connecting to the Internet, you must have a Privacy Statement (or link to web based privacy policy) in your app – usually in a custom settings fly-out (from the Settings Charm). You must also have a web-based copy of this hosted somewhere on the Internet as you’ll need to provide the URL to it when you submit your app to the store. If your app has no Internet connectivity enabled, you don’t have to do this.

More...

SHARE:

Designing Mobile Apps

I've authored three Windows Phone 7 mobile apps. This is not a huge number I know but I would like to share how I think about mobile app design. The workflow below is not limited to any particular platform and can be applied to Windows Phone, iOS, Android development or at a push Blackberry ;)

Step 1: Stop and Think

It's so easy to break open an IDE and start hacking together your app, especially if you're using great developer tools such as Visual Studio and Expression Blend. Shutdown your computer, grab a cup of coffee, sit down and think.

thinking does equal working

As a developer I have to force myself to do this, which is why shutting down your computer is a necessity! More...

SHARE: