Microsoft Details Adding In-app Purchase and Compiling Windows Phone Apps in the Cloud

In-app purchase is rapidly becoming the leading way to grow mobile app revenue. Now, that Windows Phone 8, developers can add it to apps and games, Microsoft details ideas to consider when using in-app purchase in an app, and also shared a how to add in-app purchase to app code.In-app purchase gives mobile app the […]

In-app purchase is rapidly becoming the leading way to grow mobile app revenue. Now, that Windows Phone 8, developers can add it to apps and games, Microsoft details ideas to consider when using in-app purchase in an app, and also shared a how to add in-app purchase to app code.

In-app purchase gives mobile app the opportunity to sell digital content and digital services inside a phone app. "The opportunity is significant - some estimates point to over $1 billion dollars being transacted through in-app purchase in 2011," Microsoft writes.

"Not only does in-app purchase increase the possibility that your apps will make more money, in-app purchase also will save time: by using in-app purchase dev can simply unlock some functionality in apps based on customer in-app purchase, and then no longer maintain two versions of every app--a free/lite version and a paid version," Microsoft stated.

"Windows Phone 8 offers a consistent purchase experience on the phone and safe handling of personal information, both of which contribute to a confident purchase experience for the user.

Developer can add in-app purchase to a WP8 app, as well as to Windows Phone 7 code that runs on a WP8 device. "For WP7 code, you must include error handling to detect when the app is running on a Phone 7 device, and not show the in-app purchase experience (it will not be available in the phone)," explains Bernardo Zamora, on Windows Phone blog.

Windows Phone in-app purchase offers following benefits to dev and consumers:

  • "easy-to-use purchase experience, available in 191 countries/regions
  • Integration of purchases with the PIN-secured Windows Phone Wallet for a range of payment options including credit card, PayPal, Microsoft gift card, and Mobile Operator billing with select operators
  • hardened commerce platform: server-signed receipts provide the developer with high-confidence, portable proof of purchase
  • Common namespace and Interface Definition Language (IDL) between the Windows Phone Store and the Windows Store, which simplifies porting apps between platforms
  • Flexible keyword support to help categorize products for sale," Bernardo informs.

To integrate in-app purchase follow the four steps listed below:

  1. "Understand and define the features that want to monetize.
  2. Add in-app purchase to app code to unlock content after a successful purchase.
  3. Resubmit the updated XAP in Dev Center
  4. Add the in-app products in Dev Center," Bernardo added.

in-app purchase in windows phone 8 apps

In the video "Intro to In-app Purchase on WP8" below, Product Manager Bernardo Zamora, walkthrough the basics of In-app purchase on Windows Phone.

Windows Phone 8: In App Purchase & Developer Center:

Adding In App Purchase as a 'light up' feature to your Windows Phone 7 Games:

Here are some additional In-app resources:

Microsoft also outlines the strategy for compiling Windows Phone apps in the cloud.

In addition, to Build 2012 session, there's now more publicly available information, a new Channel 9 "Going Deep" episode digs into cloud compilation, which Microsoft is advertising as enabling "really fast startup of Windows Phone 8 .Net apps."

compiling Windows Phone app in the Cloud

The way this works behind the scenes isn't via NGEN (Native Image Generator) -- "a tool for improving performance of managed applications byusing native images stored in cache rather than a just-in-time compiler. Instead, according to the Going Deep presentation, Machine Dependent Intermediate Language (MDIL) is at the core of Microsoft's compiler-in-the-cloud solution. Microsoft officials are claiming that the linking step on devices that convert MDIL assembly to a native image takes one-fifth of the time as traditional NGEN on device."

"Thus, we get some of the benefits of both pre-compilation (since we are executing off the native image where all instructions are assembly instructions) and JIT-compilation (no heavy compilation on the device during framework updates)," the video abstract read (via.

Here's how Microsoft is describing the process to Windows Phone developers:

"When you build your app in Visual Studio, the code is not compiled into a native image, but into a machine-independent Common Intermediate Language (CIL) binary file. (CIL was formerly known as Microsoft Intermediate Language, or MSIL.) This CIL file is what you submit to the Store when you're ready to sell your app. At that time, the binary file is converted from CIL to optimized Machine Dependent Intermediate Language, or MDIL. Finally, when the user downloads your app to a device, the MDIL file is linked to produce a native image. These steps are repeated in your development environment whenever you deploy your app to a Windows Phone 8 device."

"The functionality of your app is not affected by the conversion to native code. However, the native image typically starts and runs faster."

Deep Dive into the Kernel of .NET on Windows Phone 8: