Today I want to move on selling the applications written for Windows Phone 7. It seems to me, that each person creates any software wants, in addition to the satisfaction of doing something useful, obtain financial benefits. Depending on the model of sales, there are different ways to make the applications developed. However, the, in the case of phones with Windows Phone 7 the most common are the following two:

  • ads,
  • sales of Windows applications Phone Marketplace.

In this article I would like to address specifically the second way – sales application Windows Phone Marketplace.

I hope, everyone seems to realize that, application of effective sales depends primarily on how the present. In this method consists of the following factors:

  • program title,
  • description of the program,
  • materialy multimedialne,
  • demo.

Nobody likes to buy a cat in a bag and tries to choose a program, who managed to learn the best. For this reason, should be applied to the preparation of Aug. exact description and photos of the program. Advantage can also be preparing a short presentation of the program in the form of film, which will be presented to the most important of its functions and manner of operation. Not without significance is also the relevance of the program name. The more will it struck a chord with users, it easier for our program is found on the Internet, and thus have a greater chance to buy it.

 

Demo version

The theme, who wants to devote more attention is a demo program. Before the programmer faces the choice of whether its program will have a demo version, or not. In a situation, when a large number of recipients of this choice is obvious – the program must be equipped with a demo version. Microsoft gives the following facts about the demo:

  • Users love to programs equipped with demo versions. Such programs are downloaded 70 times more often than other payable without the demo programs.
  • 1 na 10 downloads the demo ends with purchase.
  • Programs equipped with a demo version generates an average of 10 times larger gains than programs without demo.
  • Programs equipped with demo versions are showing profits faster than programs without demo. In the case 50% -equipped versions of the programs in a demo, purchase full version followed in less than a day, and in most cases within 2 hours of the Ringtone.

The above statements often have, with theoretically no choice and must prepare a demo version.

So let’s start from the beginning to prepare applications equipped with demo versions. For this purpose, we will create together in the Properties class stores information about the, whether the program is used as a demo version, and also full version.

public static class VersionInfo
{
  /// <summary>
  /// Gets a value indicating whether this instance is trial version.
  /// </summary>
  /// <value>
  ///   <c>true</c> if this instance is trial version; otherwise, <c>false</c>.
  /// </value>
  public static bool IsTrialVersion { get; private set; }

Ownership IsTrialVersion is static and non-modifiable from outside the class. We use it in situations, when we want to impose any restrictions on the user have any, and check, if your program is in full version, or demonstration. Such restrictions may be:

  • limited, fire,
  • Exclusion, Be also limit some functionality,
  • definite time operation,
  • display ad.

 

Checking the license

For full utilization of the said properties must check what is the status of our application. Microsoft in this case rose to the task and prepared a very easy mechanism to do this. Class Microsoft.Phone.Marketplace.LicenseInformation provides a method IsTrial(), which returns information, whether the program is running in demo version, and also full. A very common mistake is abuse of the method IsTrial(). Due to the ease of her call up (new Microsoft.Phone.Marketplace.LicenseInformation()).IsTrial() programmers use it directly to check the status of the program. It is a mistake, which performance could be affected program. Call up methods IsTrial() may last 60 ms and more. For this reason you should, the result of her call up local store. For this purpose, will be used more than ownership IsTrialVersion.

The other thing about what you should remember is that, They metoda IsTrial() Mode debug always returns a value false. This causes the situation, you have to use some mechanism, which will allow for application testing. You can use two approaches. The first approach based on the example of the documentation:

/// <summary>
/// Updates the information about trial status.
/// </summary>
public static void UpdateTrialInformation()
{
  #if DEBUG
    MessageBoxResult result = MessageBox.Show("CLICK OK TO SIMULATE FULL LICENSE",
               "BUY NOW!", MessageBoxButton.OKCancel);
    if (result == MessageBoxResult.OK)
    {
      IsTrialVersion = false;
    }
    else
    {
      IsTrialVersion = true;
    }
  #else
     IsTrialVersion = (new Microsoft.Phone.Marketplace.LicenseInformation()).IsTrial();
  #endif
}

Microsoft suggests, that every time, when the information is refreshed by the operation mode display a dialog asking, in which version to run the program. Depending on the response the program will run in demo version, full or if he. This question will appear only in debug.

 

Demo version testing

The second solution is to use the setup project and preprocessor directives. As in the previous case, the directive will be used #if and further defined the symbol TRIAL. Method UpdateTrialInformation() will look like in the following way:

/// <summary>
/// Updates the information about trial status.
/// </summary>
public static void UpdateTrialInformation()
{
  #if TRIAL
    IsTrialVersion = true;
  #else
    IsTrialVersion = (new Microsoft.Phone.Marketplace.LicenseInformation()).IsTrial();
  #endif
}

It remains only to configure the project yet, to being able to switch between full and demo version of the program. To do this, follow these steps:

  1. Open the configuration manager.
    Configuration Manager - configuration selection
  2. Add new project configurations for selecting from a list New.
    Configuration Manager - new configuration
  3. Enter the name and indicate the, copied to the configuration settings from a named Debug.
    New Solution Configuration
  4. After clicking the button OK we should get the following view.
    Configuration manager window
  5. Finally, there is now only improve the project settings. The tab Build and the Conditional compilation symbols you must add a word TRIAL after the semicolon.
    Project properties

After completing these steps, you will be able to choose whether the application is run in full mode, and also a demo. You only need to change the active configuration:

Configuration Manager - demo version configuration selection

Such a solution seems to me better, because we have always 100% confidence in what we have started a preliminary applications.

 

Optimization of the license checking

To conclude deliberations earlier this pore already know how to check whether the application works in full mode, and also a demo and how it can emulate the demonstration in the application. We also, the method should not be overused IsTrial() because she works too slowly. Expect, So ponder where you should check, whether applications for a license has already been redeemed. Answer seems obvious – before running the program or having the first demand for this information. Both solutions are correct, but I would suggest to exploit the first.

This choice stems from the way the application to work in Windows Phone 7. In the first case, you must add a license check at the time the program starts, as well as its re-activation. In both cases, the code is the same. For the second solution – download the information in the case of the first demand – you can cancel the license checking in at the start of the program, but they need to add functionality to check the license before the first demand on her.

As you can see in both cases, the data are collected for a license as many times, only in other places. Taking into account the fact, the demo should have disabled the functionality, for which the user is willing to pay, it is possible to say, by checking the license will always. This means that, that one can only delay the checking, but does not eliminate.

Using the first solution will, the program will always behave in the same way. Possibly, with the launch of the program will take a bit more, but should always be a time comparable. In addition, you must also have regard to the fact, that users are accustomed to this, the application needs some time to start in August.

Using the second solution should speed up application start, but on the other hand, chaos can enter a small application in action. Depending on the chosen path, license check, and thus slow down the application to work, can occur in various locations. Experience teaches, that users do not like randomness and certainly raised an error, with a particular functionality can sometimes work more slowly. From the programmer’s point of view, the program works correctly, because at these moments, a license is checked. For this reason, better to choose the first solution – may appear small delay in starting the program, but at least the remaining functionality will always act with the same efficiency.

Implementation of the first solution is very simple – just run method UpdateTrialInformation() in appropriate places. Just hook the event:

  • Launching
  • Activated

 

Functionality – Buy It Now

Thus prepared, the program is ready to reduce some of the functionality. This is done by checking the value of ownership VersionInfo.IsTrialVersion. In the case,when we get value true block should be given the functionality and to inform the user of this fact. A good solution is to add functionality, which will allow for upgrades to the, where you can buy full versions of. Positive library facilitates such functionality Coding4Fun, and precisely MessagePrompt. It is a well configurable notification window. The below code shows how to use it:

MessagePrompt prompt = new MessagePrompt();
prompt.HorizontalAlignment = HorizontalAlignment.Center;
prompt.VerticalAlignment = VerticalAlignment.Center;
prompt.Title = "Buy full version";
prompt.Message = "In trial version password length is limited to 7 characters. Please buy full version to unlock longer passwords. Also full version doesn’t contain ads.";
prompt.ActionPopUpButtons.Clear();
prompt.Overlay = new SolidColorBrush(Color.FromArgb(155, 41, 41, 41));
Button btnBuyFullVersion = new Button {Content = "Buy full version"};
btnBuyFullVersion.Click += new RoutedEventHandler(btnBuyFullVersion_Click);
prompt.ActionPopUpButtons.Add(btnBuyFullVersion);
prompt.Show();

The result of operation of the code window will be as follows.

Buy full version feature

Careful reader will notice, that in the above code is missing one method – Solution button Buy full version. This method should allow the application to purchase. For this purpose, use should be made the task MarketplaceDetailTask. The use of it is very easy, sufficient to give only the identification number of applications. This method looks in the following way:

/// <summary>
/// Handles the Click event of the btnBuyFullVersion control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
void btnBuyFullVersion_Click(object sender, RoutedEventArgs e)
{
  MarketplaceDetailTask task = new MarketplaceDetailTask();
  task.ContentType = MarketplaceContentType.Applications;
  task.ContentIdentifier = "f2f8c9d6-bc9a-e011-986b-78e7d1fa76f8";
  task.Show();
}

And so we get all the elements of puzzle, that are needed, having to do a program demo versions.