Add Admob To Your Android Apps With SDK 4.3.1

On April 10, 2012, in Android, by James

Latest Update: Add AdMob with Google Play Service
Last time, I released a post for “Add Google Admob in Android Application“. And I got a feedback today about this admob android tutorial. The example code and that demo application doesn’t work any more. Then I checked my Admob account and found out that app’s Status is red, which mean my app is inactive. If the app works well, the status color should be green. And some of my apps status also show green color with exclamation mark, which means my app is idle (Your site was previously active but has not sent an ad request in the previous 72 hours).

Why My Admob APP Status is Inactive?

admob status

Admob Status Example

Currently, I only met this admob inactive problem twice. The first time is when I created a new app in the Admob. And this is the second time. Some friends ask me that they create a new Admob app. They can see the ads in the Android emulator with that publish id. And the app can also shows ads in their test phone as well. But in the Admob report, the status is still red (inactive). I think this is because that you might call adRequestset.Testing(true) or adRequestset.setTestDevices(“textdevice”) in your apps. And the admob also takes time to update their status. So for new app in Admob, you don’t need to worry if your app can show the ads :)

But my problem is here. My app worked well before. And I published it on my site to provide people to download and test. And it suddenly became inactive and the app also didn’t show the app. I didn’t get any notification about  it and there is no farther information to let me know what happened there. So I guess the reason is that I also provide the source code downloading and I remain my publish id in the source code by mistake. Many friends downloaded my source code and tried it. This may cause some invalid clicks which may violet Google policy. And eventually my publish id in admob become inactive.

Add Google Admob in Android Application With SDK 4.3.1

Since I used Admob SDK 4.0.4 in my previous example, and it is not recommended for current Admob. And that example also doesn’t work for the latest android sdk r18 and adt 18. So I will post the latest example to show you how to add Google Admob in Android application with Admob SDK 4.3.1 and Android SDK r18. For the code example, you can check source code in Admob Offical Site Tutorial. Here I will tell you why it doesn’t work when you follow that instructions.

Could not find class ‘com.google.ads.AdView’ Error

After you update the Android SDK to r17 or r18 and it will force you to update the ADT plugin for Eclipse to ADT 17.0.0 or ADT 18.0.0. With these update, you will meet several problems:

Adview can not be resolved to a type
Adrequest can not be resolved to a type
Adview can not be resolved to a variable

The solution for this problem is create a folder “libs” under your project, and moving your Admob SDK jar to “libs” folder.

before

before

after

after

Will Admob SDK 4.3.1 work in Android 2.3 (less than Android v3.2 or android-13)

Yes. It will. The Admob SDK 4.3.1 for Android requires you to compile your Android application against at least Android v3.2. If you want to make your application to be compatible to lower version, Android 2.3 or Android 2.2 for example. You can just set your android:minSdkVersion to 9 or 8 in your AndroidManifest.xml file. Here is the example:

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="13"/>

Download Example APK File
Download Source Code

Tagged with: Admobmonetize tablet applications 

13 Responses to “Add Admob To Your Android Apps With SDK 4.3.1”

  1. sirdan says:

    Thanks for this info. Big help.

  2. Nguyen says:

    Thanks U, it need for me :)

  3. Nguyen says:

    But I can’t run it.
    It is errors with display ad

    • James says:

      Hi, Nguyen

      This is the latest one.

      http://jmsliu.com/209/add-google-admob-in-android-application.html

      You can check this. If you still have problems, please leave your reply. I will help u solve that.

      • pradeep says:

        Hi i created app from appsgeyser and i am unble to activate it, you have any option to do it, Help Needed please , Thank you.

        • James says:

          Hi pradeep,

          I have checked AppsGeyser service, I think it is very hard to add AdMob in your App. I don’t know what’s the result of AppsGeyser output. But I think it help help you handle the Ads part. It says “Once your App reaches a required minimum usage, this advertising space will be shared with you.”

          and

          “For Apps with less than 100 installs there is no banner space available and no ads displayed.”

          If you find that your admob ad banner is still inactive, please check your app first.

          But I still suggest you to use AdMob with native Apps.

          Thanks

  4. max says:

    I experienced that,,, i need help,,, if you please you can check my admob .. I will send you email me with AdMob passwordna,, please help

  5. max says:

    my aplication inactive ,,, and ads that appear only 1 .. can u help ..

    • James says:

      Hi, Max

      • First, when did you create your application in AdMob?
      • Second, did you try to request AdMob Ads by this applicatioiin id?
      • Third, your admob application will become active only after there are enough ads request, according to my experience.

      Thanks

Leave a Reply

WordPress主题

WordPress Blog