AdMob's Android App Add (Unity,eclipse can)

Source: Internet
Author: User
Tags admob

1. Register your AdMob account number and get the ID website.

2. Download Admob sdk   https://github.com/unity-plugins/Unity-Admob.

3. Import the Eclipse AdMob jar.

4. I use the 4.3.1 version, which requires SDK3.2 version of the project.properties file of the target =android-13, if not change the configuration in Androidmanifest.xml, it will be tragic.

5.using AdMob.

6.admob.instance (). Initadmob ("AdMob banner id", "AdMob interstitial id");//admob ID with Format ca-app-pub-2796046890663330/756767388.

7.admob.instance (). Showbannerrelative (Adsize.banner, Adposition.bottom_center, 0).

This sentence will give an error, because uimode to 8, 13 screen size and smallestscreensize appear. The

Code is set as follows for unity:
I'm not using the XML layout, the direct code control layout is superimposed on the top of the current layout, there are occasional ads, and clicking the Close button on the ad is turned off.

If you add in unity, you need to import the Classes.jar package and then inherit the Unityplayeractivity class. If not, inherit the activity class directly and then set the view in OnCreate.

using AdMob;
Admob.instance (). Initadmob ("AdMob banner id", "AdMob interstitial id"),//initadmob just need call once,if if Create banner, you are not need call any more
Admob.instance (). loadinterstitial ();


AdMob's Android app Add (unity,eclipse)

Related Article

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.