Question

I'm using Titanium SDK 2.1.3 and developing for Android 2.3 and greater.

So far I haven't found a proper way to implement AdSense. I read I should load an HTML in a WebView, but it seems that causes to Google to disable your AdSense account.

The only module I found so far, used AdMob, but it doesn't work with my project, failing to create a R.java when compiling.

How can I integrate AdSense into my Android application? What guidelines should I follow to add this to my application in Titanium so Goodle doesn't disable my account?

I will appreciate any help you can offer.

Was it helpful?

Solution

You have to use AdMob, not AdSense, for mobile applications. The module you linked to is correct, and in working order (I'm using it currently in production apps with only minor modifications).

In android, after you have included the module in tiapp.xml, you also have to add this to your tiapp.xml:

<android xmlns:android="http://schemas.android.com/apk/res/android">
    <manifest android:versionCode="1" android:versionName="1.0">
        <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="16"/>
        <tool-api-level>16</tool-api-level>
    </manifest>
</android>

These settings worked great for me, also make sure you actually have that SDK and tool level, if not open up the Android SDK manager and download them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top