Admob error: you must have adactivity declared in androidManifest.xml with configChanges
in
Android Processing
•
1 month ago
yes, my manifest file in the android folder contains all of the essential modifications shown here:
manifest.xml file:
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.google.example.ads.xml"
- android:versionCode="1"
- android:versionName="1.0">
- <uses-sdk android:minSdkVersion="3" />
- <uses-sdk android:targetSdkVersion="15" />
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name=".BannerSample"
- android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <activity android:name="com.google.ads.AdActivity"
- android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
- </application>
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
- <uses-permission android:name="android.permission.INTERNET"/>
- </manifest>
my sketch was also modified accordingly, I have an admob account, I modified the project.properties file to contain "13" instead of "15".
Processing sketch below:
- import android.os.Bundle;
- import android.view.Gravity;
- import android.view.Window;
- import android.widget.RelativeLayout;
- import com.google.ads.*;
- int barWidth = 5;
- int lastBar = -1;
- void setup() {
- size(200, 200);
- colorMode(HSB, 360, 100, height);
- noStroke();
- background(0);
- }
- void draw() {
- int whichBar = mouseX / barWidth;
- if (whichBar != lastBar) {
- int barX = whichBar * barWidth;
- fill(barX, 100, mouseY);
- rect(barX, 0, barWidth, height);
- lastBar = whichBar;
- }
- }
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- Window window = getWindow();
- RelativeLayout adsLayout = new RelativeLayout(this);
- RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.FILL_PARENT);
- // Displays Ads at the bottom of your sketch, use Gravity.TOP to display them at the top
- adsLayout.setGravity(Gravity.BOTTOM);
- AdView adView = new AdView(this, AdSize.BANNER, "ca-app-pub-0258372998161360/2904069474"); // add your app-id
- adsLayout.addView(adView);
- AdRequest newAdReq = new AdRequest();
- // Remark: uncomment next line for testing your Ads (fake ads)
- //newAdReq.setTesting(true);
- adView.loadAd(newAdReq);
- window.addContentView(adsLayout,lp2);
- }
I'm not sure what I am overlooking. I heard I need to import into Eclipse and change the version number but I have no idea how to go about this. Help!
Thanks again.
1