Home About Me Follow Me on Twitter @mikefrancis Subscribe WP7 Resources WM Resources
# Monday, July 25, 2011

apphub

 

Todd Brix gives a summary here of the new features included in the App Hub Update that went live on July 18th. In this post I’ll review a couple of the new features and tips for using them.

App Name now determined by XAP, not entry in App Hub.

Previously you provided the application name in the description step (step 2) See screenshot below. You needed to specify this for each language your application supported. (See below.)

Pre-July 2011 App Hub Update - app name provided by developer for each language app supported.

Now with the App Hub update, the application name is derived from the Title attribute of the App element in WMAppManifest.xml:

<App xmlns="" ProductID="{xxx5d2d6-ebb1-4e5b-bd12-7e1371696e80}" Title="People and Places" 
       RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" 
       Author="Mike Francis" Description="" Publisher="Mike Francis">

This is great improvement since now the application title is maintained in one place: your application. See this blog post for information on localizing the application title.  App Hub will automatically retrieve the appropriate localized application title for each supported language. See here for a sample project with this implemented. Try creating a test submission (you can delete it later) and upload the resulting XAP file from the sample. Note how App Hub is creating a language version for each language supported. Also note how the localized application name is automatically populated.

image

Default Language now must be specified in Project Settings

As stated in this forum post, the App Hub now requires a default language specified in your application. This is the ‘Neutral Language’ assembly setting in Project settings.

  1. Right Click on your project in Solution Explorer
  2. Application | Assembly Information. . .
  3. Neutral Language
  4. Pick a specific default language. For example for English:

image 

App artwork can now be specified in one click!

In the ‘Describe’ section (step 2) of your application submission, you provide the screenshots and icons that are used by the PC and Phone versions of Marketplace. Another nice AppHub feature is the ability to upload all of the artwork at once. You can do this as long as you have the art work in the same directory. For my application, I have created a directory <Project Name>\Images\Marketplace and placed my icons and screenshots there. Then when submitting my app, in the ‘Artwork’ section of step 2, I click ‘Browse”, and multi-select all of the artwork in this folder. App Hub intelligently associates the correct size icon with the corresponding App Hub icon slot. See video below.

App Hub: One click application art upload

Tip: This feature reads the screenshot images in alphabetical order, so if you care about the order of your screenshots, rename them so that the filenames are in alpha-order. This way when the tool reads in your screenshots, they will be in the order you expect. For example, (1ScreenShot.png, 1ScreenShot.png, etc.)

screenshots in alpha order

Thanks,

Mike

posted on Monday, July 25, 2011 8:02:15 AM UTC  #    Comments [0] Trackback
# Saturday, July 02, 2011

image

The Coding4Fun library (http://coding4fun.codeplex.com) for Windows Phone 7 includes many super useful classes that will save you time when writing Windows Phone 7 applications. My favorite is their implementation of very the professional looking and easily extensible user prompts.

While a good assortment of prompts, utilities and other controls have been implemented in coding4fun, what is missing is a login prompt. In this post I’ll review how I’ve used Coding4Fun to create a login prompt.

Can’t I just use a login page?

Many developers have struggled with the Microsoft enforced application navigation flow that mandates:
1) Pressing the Back button must return the application to the previous page or return to any previous page within the back stack.
2) Pressing the Back button from the first screen of an application must close the application.

These rules are difficult to reconcile with an application that has a login prompt on the first page. A couple of problems with this:
1) After the user has successfully logged in, and they have navigated away from the login page, it is confusing if pressing BACK returns them to the Login screen. The expectation is that once they have logged in they should not see the login screen again.
2) Even if you structure the program to navigate to the Login page automatically from the main page if the user has not yet logged in, this gets rid of the ‘BACK navigates to the Login screen’ problem, but it violates the first rule above where BACK on the first screen should exit the app.

See Peter Torr’s article, Introducing the concept of “Places”, for a way to think of ‘places’ and ‘transient UI’. In Peter's article, he recommends one way to handle the login scenario is with the use of a popup. Enter Coding4Fun.

How It Works

The Coding4Fun’s MessagePrompt class, includes a Body property that you can use to add code on the fly. For example:

messagePrompt.Body = new TextBlock { Text = "Hello World!", Foreground = new SolidColorBrush(Colors.Green),

FontSize = 30.0}

I extended this idea to include, a user control ‘LoginUserControl’ which contains the XAML layout and Username and Password members which are databound to the user control.

In the code below I instantiate the LoginUserControl control, add it to the Body member of an instance of MessagePrompt, display the prompt, and process the user results.

private void Button_Click(object sender, RoutedEventArgs e)
{
    var luc = new LoginUserControl(); // Customer user control with Login UI
    MessagePrompt messagePrompt = new MessagePrompt(); // Coding4Fun extensible MessagePrompt
    messagePrompt.IsCancelVisible = true; // Show cancel button
            
    messagePrompt.Body = luc; // Add user control as body of MessagePrompt
    messagePrompt.Completed += (str, res)=> // Handler for MessagePrompt user action
    {
 
       if (res.PopUpResult == PopUpResult.Cancelled)
        {
            luc.Username = luc.Password = "";
            MessageBox.Show("Login Cancelled");
        }
        else
        {
            MessageBox.Show(string.Format("Username: {0}, Password: {1}", luc.Username, luc.Password));
        }
    };
            
    messagePrompt.Show(); 
}

You can download the sample code here.

Mike

posted on Saturday, July 02, 2011 7:32:02 AM UTC  #    Comments [0] Trackback