Guidelines for Developing Windows 8 Apps for Standard 8 (Standard 8)

7/8/2014

Review the guidelines and sample code for developing Windows 8 apps for Windows Embedded 8 Standard (Standard 8).

You can create Windows 8 apps for Windows Embedded 8 Standard (Standard 8) by using the same methods and tools that you use to create apps for Windows 8. For more information about developing Windows 8 apps, see Windows 8 app development. This topic provides guidelines for developing specialized Windows 8 apps that take advantage of features that are available in Standard 8 but are not available in Windows 8, such as Windows 8 Application Launcher.

Tools

You must use Visual Studio 2012 to create your Windows 8 app.

Exit a Windows 8 App

When Windows or a user exits a Windows 8 app, Windows sends a Suspending | suspending event to the app before exiting the app. If your app has registered an event handler for the suspend event, your app can inspect the ApplicationExecutionState to detect if and how the app is exited. Generally, Windows 8 apps do not return an exit code when they are exited, whether by the user or by Windows.

For more information about the Windows 8 app lifecycle, see Application lifecycle.

Return an Exit Code

To simulate an exit code value, your app can write a local application data setting, CustomExitCode, before exiting. We recommend that you clearly document these exit code values.

Windows 8 Application Launcher inspects the local application data store for the CustomExitCode setting to determine the exit code for the Windows 8 app.

The following sample code shows how you can write this in a C# Windows 8 app:

var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

localSettings.Values[“CustomExitCode”] = 1;

The following sample code shows how you can write this in a JavaScript Windows 8 app:

var applicationData = Windows.Storage.ApplicationData.current; 
var localSettings = applicationData.localSettings; 

localSettings.values["CustomExitCode"] = 1;

For more information about how to map these exit codes values to exit behavior, see Configure Windows 8 Application Launcher.

Application Self Exit

Your app can also exit itself. Windows 8 treats this as an application crash. In these cases, we recommend that your app write the CustomExitCode value right before it exits.

Warning

If your Windows 8 app includes any UI elements that enable a user to exit the app, the app cannot be certified by the Windows Store.

The following sample code shows how your app can forcibly exit itself in a C# Windows 8 app:

Application.CurrentExit();

The following sample code shows how your app can forcibly exit itself in a JavaScript Windows 8 app:

MSApp.terminateApp();

Identify the Application User Model ID (AUMID)

Standard 8 features that work with Windows 8 apps use the Application User Model ID (AUMID) to identify the app. If you are an independent software vendor (ISV), you must provide the AUMID of your app to the OEM or system administrator designing the Standard 8 image.

The AUMID format is the package family name followed by an exclamation point and the application ID. The application ID can be found in the AppxManifest.xml file, under the <Applications> element.

To identify the AUMID of an installed app

  1. At a PowerShell command prompt, type the following commands to list the AUMID s for all Windows 8 apps installed for the current user on your device:

    $installedapps = get-AppxPackage
    
    foreach ($app in $installedapps)
    {
        foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id)
        {
            $app.packagefamilyname + "!" + $id
        }
    }
    

    You can add the –user <username> or the –allusers parameters to the get-AppxPackage cmdlet to list AUMID s for other users.

    -or-

    At a command prompt, type the following command:

    reg query HKEY_CURRENT_USER\Software\Classes\ActivatableClasses\Package /s /f AppUserModelID | find "REG_SZ"
    

See Also

Concepts

Windows 8 Application Launcher Overview