My first Windows Store application!

My first application for Windows Store is already published! It is a very simple application but now I know the complete process to publish an application on Windows Store.

The application is localized, at the moment available in English and Spanish. More Localization details.

image

I have developed this application before for Windows Phone.  I used a Portable class library to implement the Business Logic of the application – Models and Common classes.  The Views and View Models are contained in different platform specific projects (Windows 8.1 + Windows Phone 8) . More details here.

These are a couple of screenshots of the Application:

WindowsClockimage

It is optimized to run on PCs and Tablets with Windows 8.1. You can execute it in full screen or snapped mode. More details here.

Snapped mode

image

Tablet simulator

image

I will publish a small guide with the requirements to publish an application on Windows Store soon, the process is easy and very good explained, but there are some stuff to prepare: an email contact, privacy policy link, application screenshots, etc.!

Advertisements

Windows 8.1 – Localization

Today I want to share how I localized my Windows Store application, very easy! Localization can also be implemented using “Resources File (.resw)” files. I will try it soon but first I wanted to implement a solution using my already existing resx files.

To test the developing process for Windows Store and Windows Phone I am using this project structure:

projects

All localization terms are already in a portable class library, so that they are share between the Windows Phone and Windows 8 applications.

image

The terms are contained in “resx” files:

  • AppResources.resx (default app language, English)
  • AppResources.es-ES.resx  (Spanish)
  • AppResources.fra.FR.resx (French)

These files contains a list of string properties that we can create be created easily using the editor:

image

Once the project is compiled a class “AppResources” with a property of type string with each entrance of the table is created. The value of the string is resolved using the resx corresponding to the current language of the UI Thread.

There are several ways to use this resources files in XAML, I wanted to use them with the support of IntelliSense, with my solution it is possible to define a common Localization Provider on my App.xaml that uses the resources files contained by the portable class library: Continue reading

Windows 8.1 – Application life-cycle

Windows 8.1 keeps in memory the status of an application when the user sends it to background. Although the application’s threads are frozen after about 10 seconds, the application status is kept in memory until the OS runs out of resources.

When the OS needs resources the application could be removed from memory and if this happens the status is lost.

Understanding the possible status of the application and the related events helps to create a better user experience.
e.g.: Serializing the application status to disk when it’s suspended to recover it later.

This diagram describes the life cycle of a Windows 8.1 application.

Windows 8.1 App Lifecycle

Windows 8.1 App Lifecycle

References:

Windows 8.1 – Screen Mode Detection

During the development of my Windows Store application I faced out that is not that easy to detect the current screen mode to adjust consequently the layout.

These are the different screen modes available in Windows 8:

  • Portait orientation.
  • Landscape orientation, Full Screen.
  • Landscape orientation, Snapped. Sharing the screen with other applications, see the next image as an example.

Windows 8 - Screen Sharing

When the application is sharing the screen with other applications it is also important to distinguish between having a big portion of the screen or not:

smallPortionScreen

In Windows 8 it was easier to detect the screen mode:

private void WindowSizeChanged(object sender, WindowSizeChangedEventArgs e) {
    // Get view state
    ApplicationViewState currentViewState = ApplicationView.Value;

    if (currentViewState == ApplicationViewState.FullScreenLandscape) {
       // Full screen Landscape layout
    }
    else if (currentViewState == ApplicationViewState.FullScreenPortrait) {
       // Full screen Portrait layout
    }
    else if (currentViewState == ApplicationViewState.Filled) {
       // Filled layout
    }
    else if (currentViewState == ApplicationViewState.Snapped) {
       // Snapped layout
    }
}

But in Windows 8.1 the ApplicationView is deprecated, developers can only know if the screen is in Landscape or Portrait. I implemented a helper class called ScreenManager to get the current screen mode, this class has also an Event to notify when the screen mode changed:

These are the Screen Modes that I defined: Continue reading