The Trials of Trial Mode

I would have been done with Fraction Calculator sooner if not for the need to cram Trial Mode into it first.  Microsoft recommends it, since more users will download an app if they can try it out first, and apparently most people who go for the trial will upgrade to the full edition within just a few hours.  I hope so, because my download rate is, for want of a better and more cheery term, abysmal.  I don’t know what I was thinking with this app, but it would be nice to be able to earn at least minimum wage making apps for Windows Phone! 

Actually, I am fairly certain that most Windows Phone users WON’T have an urgent need for a fraction calculator, but hope springs eternal that maybe a few hundred might.  So, enter Trial Mode.

My first foray into Trial was quite a trial, in fact, since I didn’t understand things very well (see my earlier post regarding this).  But after acquiring some understanding, it took some good trial and error to incorporate the feature effectively.

First decision I had to make was what exactly I was going to do to give the user a good idea of the app’s usability without giving away the entire farm — I don’t like crippleware, but that’s pretty much all one can do in trial mode.  Users can download the app multiple times, and if I were to set a certain number of uses as the limit, then they could reset it at need.  I finally hit on the notion of limiting the user to one mathematical operation while in trial.  And since Addition and Subtraction of fractions are the two hardest operations to do manually, it seemed a good idea to permit the user to only multiply fractions, since this is the easiest operation to do manually.  It would give users a good idea of how the app worked, while not enabling them to use it forever for the hardest operations.  So, allow only multiplication.  Good.

I created a Buy button (a nice dollar sign) for the AppBar, and made its appearance contingent upon trial mode.  I also coded the operation button so it would display a “nag” screen if the user tried to switch to anything other than multiplication.  And to check for trial mode I created the following:

public MarketplaceDetailTask detailTask = new MarketplaceDetailTask();

/// 
/// Checks the marketplace to see if app is in Trial mode.  
/// If the debugger is attached, provides option to select 
/// which mode is active for debugging purposes.  
/// 
/// 
public static bool AppIsInTrial()
{
    bool inTrial = false;

    if (System.Diagnostics.Debugger.IsAttached)
    {
        MessageBoxResult result = MessageBox.Show("CLICK OK TO SIMULATE FULL LICENSE", "BUY NOW!", MessageBoxButton.OKCancel);

        if (result == MessageBoxResult.OK)
        {
            return false;
        }
        else
        {
            return true;
        }
    }
    else
    {
        inTrial = licenseInfo.IsTrial();
        return inTrial;
    }
}
 

There is code in the fragment above which checks to see if one is in the debugger, and if so, then there’s no license info to actually check. And so in that case it gives you the opportunity to arbitrarily decide whether you’re in trial or not, and then it acts accordingly. Anyway, the statement “inTrial = licenseInfo.IsTrial();” is the way to check to see if the app has been purchased by the user.

I won’t go into all the mess-around I had to do in order to get this to work properly, but it wasn’t quite as bad as all that once I finally got it done. But there was a LOT of trial and error, let me aver.

Oh, and since I didn’t want the app to fail due to the inability to get to the Marketplace to verify the license, after the app verifies that the user is indeed licensed, then it saves information to this effect in Isolated storage so if the app can’t phone home, it will nevertheless not suddenly drop the user back into Trial Mode.


Advertisements
This entry was posted in Windows Phone 7 Development. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s