Unity 3D Access mobile mm (3.1.3) Billing SDK

Source: Internet
Author: User

First of all want to spit groove mobile mm SDK, is simply for unity developers looking for something to do. I am a unity small white, is to help colleagues to pick up this SDK, so everything in accordance with the rules of small white to write, I hope there is no omission.

Example code: http://download.csdn.net/detail/oulong999/8628673
1. Android Library file
Create a new Android project and mark it as a library file project.
Refer to the Billing SDK's help documentation to import the SDK.
1> Copy the Mmbilling.3.1.3.jar file to the Libs directory of the application project, if there is no such directory, you can create a new
2> right-click in Project Explorer and select "Properties" from the popup menu;
3> in the menu item on the left side of the Properties window, click "Java Build Path" and select "Libraries" on the right.
4> Click the "Add JARs ..." button, in the pop-up window, select the Jar file
Refer to the documentation or sample code to modify the Androidmanifest.xml file.

This creates a class that inherits unityplayeractivity, and the initialization of the SDK is put into the OnCreate function to execute. See the SDK sample code for details. The Java calling code of the SDK is written and exported into a library file.

2.Unity Engineering
A. Place the library file imported above into the Plugins/android/bin directory.

B. Put the Mmbilling.3.1.3.jar file in the Plugins/android/libs folder.

B. Put the libidentifyapp.so,libcasdkjni.so,libcmcc_haze.so and libcmcc_rusteze.so four library files under the Plugins/android/libs/armeabi folder. I put these four files under the armeabi-v7a and Armeabi folders.

C. Place the modified Androidmanifest.xml file and the MMPayAndroid.cs file in the resource bundle in the Plugins/android directory. Of course CS file you can also put somewhere else.

Now you can call the billing interface where you need it.

D. Unzip the Mmbilling.3.1.3.jar with the compression software. Copy the MMIAP under the assets file to the Assets/streamingassets directory. This directory is not created by itself.

and then pack. When you think that everything has been done, The spit groove has just begun.

Get the pack ready for you to play.
The following benefits from this blog post, or I spit blood for one months also can not answer this SDK. Thank
Http://www.j2megame.com/html/xwzx/ty/4164.html

Tools to use:
androidmultitool:http://forum.xda-developers.com/showthread.php?t=2326604
The tool is used to decompile, package, and re-sign. Of course, you can use the Apktool,aapt,jarsigner tools directly to get them.

Corresponding steps:

Step One: Decompile the package that unity is playing. There is no need to make any changes here. It would be a good time to modify the Androidmanifest.xml file if you want to open the Debug.
Step Two: Repackage the folder that was compiled by step one.
Step three: Use the AAPT tool to add the copyrightdeclaration.xml,mmiap.xml,version three files to the root directory of the APK. These three files were made from Mmbilling.3.1.3.jar's unpacking package. AAPT can be found under Program_files under the Androidmultitool folder.
All the files we need to use are placed in the Program_files directory:

Add the file to the APK using AAPT a test.apk filename.

AAPT l test.apk View, three files have been successfully added to the package

Step four: Re-sign the processed package.

SDK Access Complete!!!

PS: Discover Unity's print tag is "unity" so debug Unity app, put debugging open, in Eclipse in Logcat a filter, can.

Unity 3D Access mobile mm (3.1.3) Billing SDK

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.