Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62bb3961 authored by quddusc's avatar quddusc Committed by Android Git Automerger
Browse files

am ecaef80c: am 2a1ac705: am e772ce34: am 3a3290e3: am 096c7f7b: am f353c9ed:...

am ecaef80c: am 2a1ac705: am e772ce34: am 3a3290e3: am 096c7f7b: am f353c9ed: Merge "docs: Fix IABv3 AIDL installation instructions for Eclipse users. Bug: 8282080" into jb-mr1.1-docs

* commit 'ecaef80c':
  docs: Fix IABv3 AIDL installation instructions for Eclipse users. Bug: 8282080
parents a81bbbfd ecaef80c
Loading
Loading
Loading
Loading
+41 −9
Original line number Original line Diff line number Diff line
@@ -40,31 +40,63 @@ parent.link=index.html


<p class="note"><strong>Note:</strong> To see a complete implementation and learn how to test your application, see the <a href="{@docRoot}training/in-app-billing/index.html">Selling In-app Products</a> training class. The training class provides a complete sample In-app Billing application, including convenience classes to handle key tasks related to setting up your connection, sending billing requests and processing responses from Google Play, and managing background threading so that you can make In-app Billing calls from your main activity.</p>
<p class="note"><strong>Note:</strong> To see a complete implementation and learn how to test your application, see the <a href="{@docRoot}training/in-app-billing/index.html">Selling In-app Products</a> training class. The training class provides a complete sample In-app Billing application, including convenience classes to handle key tasks related to setting up your connection, sending billing requests and processing responses from Google Play, and managing background threading so that you can make In-app Billing calls from your main activity.</p>


<p>Before you start, be sure that you read the <a href="{@docRoot}google/play/billing/billing_overview.html">In-app Billing Overview</a> to familiarize yourself with concepts that will make it easier for you to implement In-app Billing.</p>
<p>Before you start, be sure that you read the <a href="{@docRoot}google/play/billing/billing_overview.html">In-app Billing Overview</a> to familiarize yourself with 
concepts that will make it easier for you to implement In-app Billing.</p>


<p>To implement In-app Billing in your application, you need to do the following:</p>
<p>To implement In-app Billing in your application, you need to do the 
following:</p>
<ol>
<ol>
  <li>Add the In-app Billing library to your project.</li>
  <li>Add the In-app Billing library to your project.</li>
  <li>Update your {@code AndroidManifest.xml} file.</li>
  <li>Update your {@code AndroidManifest.xml} file.</li>
  <li>Create a {@code ServiceConnection} and bind it to {@code IInAppBillingService}.</li>
  <li>Create a {@code ServiceConnection} and bind it to 
  <li>Send In-app Billing requests from your application to {@code IInAppBillingService}.</li>
{@code IInAppBillingService}.</li>
  <li>Send In-app Billing requests from your application to 
{@code IInAppBillingService}.</li>
  <li>Handle In-app Billing responses from Google Play.</li>
  <li>Handle In-app Billing responses from Google Play.</li>
</ol>
</ol>


<h2 id="billing-add-aidl">Adding the AIDL file to your project</h2>
<h2 id="billing-add-aidl">Adding the AIDL file to your project</h2>


<p>The {@code TriviaDriva} sample application contains an Android Interface Definition Language (AIDL) file which defines the interface to Google Play's In-app Billing service. When you add this file to your project, the Android build environment creates an interface file (<code>IIAppBillingService.java</code>). You can then use this interface to make billing requests by invoking IPC method calls.</p>
<p>{@code IInAppBillingService.aidl} is an Android Interface Definition 
Language (AIDL) file that defines the interface to the In-app Billing Version 
3 service. You will use this interface to make billing requests by invoking IPC 
method calls.</p>
<p>To get the AIDL file:</p>
<ol>
<li>Open the <a href="{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a>.</li>
<li>In the SDK Manager, expand the {@code Extras} section.</li>
<li>Select <strong>Google Play Billing Library</strong>.</li>
<li>Click <strong>Install packages</strong> to complete the download.</li>
</ol>
<p>The {@code IInAppBillingService.aidl} file will be installed to {@code &lt;sdk&gt;/extras/google/play_billing/}.</p>


<p>To add the In-app Billing Version 3 library to your project:</p>
<p>To add the AIDL to your project:</p>
<ol>
<ol>
<li>Copy the {@code IInAppBillingService.aidl} file to your Android project.
<li>Copy the {@code IInAppBillingService.aidl} file to your Android project.
  <ul>
  <ul>
  <li>If you are using Eclipse: Import the {@code IInAppBillingService.aidl} file into your {@code /src} directory. Eclipse automatically generates the interface file when you build your project.</li>
  <li>If you are using Eclipse: 
  <li>If you are developing in a non-Eclipse environment: Create the following directory {@code /src/com/android/vending/billing} and copy the {@code IInAppBillingService.aidl} file into this directory. Put the AIDL file into your project and use the Ant tool to build your project so that the
     <ol type="a">
        <li>If you are starting from an existing Android project, open the project 
in Eclipse. If you are creating a new Android project from scratch, click 
<strong>File</strong> &gt; <strong>New</strong> &gt; <strong>Android Application 
Project</strong>, then follow the instructions in the <strong>New Android 
Application</strong> wizard to create a new project in your workspace.</li>
	<li>In the {@code /src} directory, click <strong>File</strong> &gt; 
<strong>New</strong> &gt; <strong>Package</strong>, then create a package named {@code com.android.vending.billing}.</li>
	<li>Copy the {@code IInAppBillingService.aidl} file from {@code &lt;sdk&gt;/extras/google/play_billing/} and paste it into the {@code src/com.android.vending.billing/} 
folder in your workspace.</li>
     </ol>
  </li>
  <li>If you are developing in a non-Eclipse environment: Create the following 
directory {@code /src/com/android/vending/billing} and copy the 
{@code IInAppBillingService.aidl} file into this directory. Put the AIDL file 
into your project and use the Ant tool to build your project so that the
<code>IInAppBillingService.java</code> file gets generated.</li>
<code>IInAppBillingService.java</code> file gets generated.</li>
  </ul>
  </ul>
</li>
</li>
<li>Build your application. You should see a generated file named {@code IInAppBillingService.java} in the {@code /gen} directory of your project.</li>
<li>Build your application. You should see a generated file named 
{@code IInAppBillingService.java} in the {@code /gen} directory of your 
project.</li>
</ol>
</ol>




+1 −20
Original line number Original line Diff line number Diff line
@@ -3,26 +3,7 @@ parent.title=In-app Billing
parent.link=index.html
parent.link=index.html
@jd:body
@jd:body


<!--notice block -->
<div id="qv-wrapper">
    <div style="background-color:#fffbd9;width:100%;margin-bottom:1em;padding:8px 8px 1px;">
      <p><em>15 February 2013</em></p>
      <p>In-app Billing V3 now supports subscriptions and you can get
        started developing today. A small app update is currently being
        rolled out to Android devices. This process is automatic and
        most devices will get the update in the next few days. However,
        if you wish to get the update today to start developing right
        away, simply reboot your device. </p>

      <p>However, we recommend that you <em>do not publish</em> an app with 
        V3 subscriptions until all Android devices have received the update. We'll
        notify you here that all devices have received the update and its safe
        to publish your apps that use V3 subscriptions. </p>
    </div>

<!-- Use non-standard wrapper to support notice block. Restore standard 
     wrapper when notice is removed. -->
<!--<div id="qv-wrapper"> -->
<div id="qv-wrapper" style="margin-top:.25em;">
<div id="qv">
<div id="qv">
  <h2>Quickview</h2>
  <h2>Quickview</h2>
  <ul>
  <ul>
+4 −4
Original line number Original line Diff line number Diff line
@@ -38,10 +38,10 @@ next.link=list-iab-products.html
<ol>
<ol>
<li>Open the <a href="{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a>.</li>
<li>Open the <a href="{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a>.</li>
<li>In the SDK Manager, expand the {@code Extras} section.</li>
<li>In the SDK Manager, expand the {@code Extras} section.</li>
<li>Select <strong>Google Play Billing Library</strong>. Make sure to select the download for In-app Billing Version 3 or above.</li>
<li>Select <strong>Google Play Billing Library</strong>.</li>
<li>Click <strong>Install</strong> to complete the download.</li>
<li>Click <strong>Install packages</strong> to complete the download.</li>
</ol>
</ol>
<p>The sample files will be installed to {@code /your/sdk/location/extras/google/play_billing/in-app-billing-v03}.</p>
<p>The sample files will be installed to {@code &lt;sdk&gt;/extras/google/play_billing/}.</p>


<h2 id="AddToDevConsole">Add Your Application to the Developer Console</h2>
<h2 id="AddToDevConsole">Add Your Application to the Developer Console</h2>
<p>The Google Play Developer Console is where you publish your In-app Billing application and  manage the various digital goods that are available for purchase from your application. When you create a new application entry in the Developer Console, it automatically generates a public license key for your application. You will need this key to establish a trusted connection from your application to the Google Play servers. You only need to generate this key once per application, and don’t need to repeat these steps when you update the APK file for your application.</p>
<p>The Google Play Developer Console is where you publish your In-app Billing application and  manage the various digital goods that are available for purchase from your application. When you create a new application entry in the Developer Console, it automatically generates a public license key for your application. You will need this key to establish a trusted connection from your application to the Google Play servers. You only need to generate this key once per application, and don’t need to repeat these steps when you update the APK file for your application.</p>