I’m trying to get AdMob working with my android app and I’m having some trouble. I’ve changed the target sdk to 15 in both the manifest and in project.properties and I’ve declared the AdActivity in the manifest, but it is still not recognizing the import com.google.ads.* in my activity. How can I get this to work?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.firstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:icon="@drawable/blue_ship"
android:label="@string/app_name"
android:theme="@style/AppTheme"
>
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:screenOrientation="landscape"
android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.app.firstapp.StartGame"
android:screenOrientation="landscape"
android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>/>
</application>
</manifest>
You should set target as Google API’s, And need to add Admob sdk lib/jar instead of Android target.
1) Right Click on Project> Properties >Android > Project Build Target.
from target window choose Google Api’s(Vendor name is Google inc there)
2) Add admob sdk lib in your project via Config build path option,