GooglePlay payment related Data part finishing

Source: Internet
Author: User

This article is only a record of the information when the point drops. Do not do a detailed collation, can only be considered collection.

Google Play in-app payments

Http://developer.android.com/training/in-app-billing/preparing-iab-app.html#Connect

Http://developer.android.com/training/in-app-billing/index.html

  1. Go to the Google Play Developer console site http://play.google.com/apps/publish and log in. You'll need to the register for a new developer account, and if you had not registered previously. To sell In-app items, you also need to any of the Google payments merchant account. (Create our Google Play developer account and Google Wallet's merchant account)

  2. In the All Applications tab, add a new application entry.
    Click ADD New Application.
    Enter a name for your new In-app billing application.
    Click Prepare Store Listing.
    In the Services & APIs tab, find and make a note of the license key, Google Play generated for your Applica tion. This is a Base64 string, you'll need to include in your application code later. (Create an app, and a corresponding account)

  3. Existing Project
    To add the In-app billing Version 3 Library to your existing In-app billing project:
    Copy the Iinappbillingservice.aidl file to your Android project.
    In Android studio:create a directory named Aidl under Src/main, add a new package com.android.vending.billing in this dir Ectory, and import the Iinappbillingservice.aidl file into this package.
    In Eclipse:import the Iinappbillingservice.aidl file into your/src directory.
    In other dev environments:create the following directory/src/com/android/vending/billing and copy the Iinappbillingservi Ce.aidl file into the This directory.
    Build your application. You should see a generated file named Iinappbillingservice.java in The/gen directory of your project.
    Add the helper classes from The/util directory of the trivialdrive, sample to your project. Remember to the "the package" name declarations in those files accordingly so that your project compiles correctly.
    Your project should now contain the In-app billing Version 3 Library.our apps needs to has permission to communicate Reque ST and response messages to the Google Play ' s billing service. To give your app the necessary permission, add this line in your androidmanifest.xml manifest file: (add Aidl file, and Tools class, and Andro Idmanifest.xml permissions Information) (Android Studio easy to extract, add Aidl file, reaction half a day to generate a class file)

  4. Create an activity demo that shows our results; stick to the key part of the code


IabHelper mHelper;
@Override
public void onCreate(Bundle savedInstanceState) {
// ...
String base64EncodedPublicKey;
// compute your public key and store it in base64EncodedPublicKey
mHelper = new IabHelper(this, base64EncodedPublicKey);
mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
public void onIabSetupFinished(IabResult result) {
if (!result.isSuccess()) {
// Oh noes, there was a problem.
Log.d(TAG, "Problem setting up In-app Billing: " + result);
}
// Hooray, IAB is fully set up!
}
});
@Override
public void onDestroy() {
super.onDestroy();
if (mHelper != null) mHelper.dispose();
mHelper = null;
}
}

Google services

Basically the test was successful,
http://www.techotopia.com/index.php/Integrating_Google_Play_In-app_Billing_into_an_Android_Application_%E2%80% 93_a_tutorial

A very good tutorial

Google Play also provides a URL method for obtaining list information for a product;
There is no problem with querying the interface

A bug that needs to fix Google Play refers to a bug that pays for the interface after the purchase is clicked again, appears
Can ' t start async operation (Launchpurchaseflow) because another async operation (Launchpurchaseflow) is in progress

Http://stackoverflow.com/questions/15628155/android-in-app-billing-cant-start-launchpurchaseflow-because-launchpurchaseflo

Scenario 2

https://code.google.com/p/marketbilling/source/detail?r=7ec85a9b619fc5f85023bc8125e7e6b1ab4dd69f&path=/v3/ Src/com/example/android/trivialdrivesample/mainactivity.java

http://stackoverflow.com/questions/22447377/ Calling-startintentsenderforresult-from-fragment-without-using-existing-activit

Buy Product Test

Test accounts for authorized users. (Add test account)

Test account to download app on Google Play

Test phase Google Play completes the test and does not send the data to the financial process and automatically cancels the purchase

Add to test channel, only test account can see

You can do end-to-end testing of your apps by publishing it to an alpha distribution channel. This allows-publish the app to the Google Play store, but the limit it availability to just the testers you designate.

    1. Upload app to test channel Google Play console Upload your application to the Alpha distribution channel with the Developer Console.
    2. Add Product List
    3. Install the App

Add a license account to the user
Create license test accounts for authorized users
Clear the cache, open the URL of the app under the test channel and download the app via Google Play
Note that Google Play has to use the previous test account, login, download, the most direct way is, on the computer side, click on the link, and then switch to the app installation page, and then install to push to the Android side.

The download function starts on the Android side.

Verification tasks:

After the payment is complete, you need to check it and refer to the first answer.
Http://stackoverflow.com/questions/12427479/am-i-getting-the-steps-right-for-verifying-a-users-android-in-app-subscription

    1. Create a WEB application account in the Google APIs Console.

Can be in the query interface, according to Skuid, to obtain the goods we have purchased.

It's happened because you're not properly added consume listener, first let's know why it's required consume finish list Ener (and Queryinventoryasync) called when your item was purchased, and Google Play store registered that your item is Purch Ased successfully, so-Google Play allow user next time-purchase same product from the same Google account.

Security:
    1. Perform Signature Verification Tasks on a server (checksum on servers)
    2. Protect your unlocked content. (Local content encryption)
    3. Obfuscate your code (obfuscation)-keep class com.android.vending.billing.**
    4. Modify all sample application code (modify case codes)
    5. Use secure random nonces
    6. Set the developer payload string when making purchase requests
    7. Take action against trademark and copyright infringement
    8. Implement a revocability scheme for unlocked content
    9. Protect your Google Play public key

Http://stackoverflow.com/questions/11671865/how-to-protect-google-play-public-key-when-doing-inapp-billing

Http://developer.android.com/google/play/billing/billing_best_practices.html

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

GooglePlay payment related Data part finishing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.