Unity 3D process for adding ads to APK packages

Source: Internet
Author: User

http://hunterwang.diandian.com/post/2012-11-23/40042217286

Recently has been struggling with unity for Android app to add ads, with Unity3d do Android I still the first time, after several twists and ends finally fix, share the general flow of advertising, for your reference.

First step: Create an Android app with Eclipse. In the Androidmanifest.xml file, add the following permissions, the permissions function is not much to say. The ad's SDK description should be clear.

Then add ads to the label, like this also in the Advertising SDK has explained

Then the Androidmanifest.xml file has been completed.

Step two: The Import SDK is first imported to the SDK that provides you with an advertising platform, followed by the SDK to import the advertisers you have loaded. The third is to join the Unity Android class file package in the Unity installation file to find Date->playbackengines->androidplayer->bin->class.jar The file is imported into your eclipse inside the bin of the Android app and, build path.

Step three: How to add ads dynamically. Write the following code under the Jara file that you applied to the SRC folder


This is where the Android code has been written.

Fourth step: Build your current Eclipse project. All the files in the code are in the Bin folder. You can export the current project directly to a jar file. Then remove all files in the jar file except COM unexpectedly and then go to name your jar file as COM. Name of the project. I believe that the people who build the game with unity are not strangers. Our Bundleid is named this way.

Fifth Step: We open the original project of our Android unity. Then create a new Android folder in plugins (which is the folder where we often put the plugins) file. Then put a total of four items (files and folders) under the Android folder. The first one is our Androidmanifest.xml file. The second puts the entire folder of RES in your app just in Eclipse. The third new Libs folder contains the SDK package that was originally imported. The fourth one is to create a new bin folder. Inside, put the new fourth step jar file in. The following pattern.

That's it. You can build into an apk and try the effect. Very cumbersome I mainly refer to a few two blog blog, this is the Momo of the Rain Pine Blog:

http://www.xuanyusong.com/archives/667;

There is also a blog shared by a friend:

http://blog.csdn.net/dlnuchunge/article/details/7926603

And there are a lot of friends around to help. I'm finally getting it done, thank you.

Unity 3D process for adding ads to APK packages

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.