What is correct xmlns url for AdMob in Android Layout XML
I am testing the AdMob for Android SDK. I can't set the admob:testing="true"
because the admob attribute is unknown.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:admob="http://schemas.android.com/apk/res/org.ifies.android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#FF000000"
android:clickable="true"
>
<com.admob.android.ads.AdView
android:id="@+id/admob"
android:visibility="visible"
android:layout_width="fill_parent"
android:layout_height="100px"
android:background="#FF0000"
admob:testing="true"
/>
</LinearLayout>
My Eclipse is complaining that admob:testing="true"
would have an unknown prefix. Anyone got an idea on how to fix this?
Sub question: Anyone got an idea how to change the height of the ad? It seems to be fixed to 48px, which is not looking good on any DROID phone...
Asked by: Alissa647 | Posted: 25-01-2022
Answer 1
This took me a while to figure out, so I am posting it here:
Since AdMob 4.1 this has changed, so the previous answer is correct for versions <=4.04. Now you need to use:
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
No place for your own package in the new schema and no need for an attrs.xml file.
Details here: http://groups.google.com/group/google-admob-ads-sdk/browse_thread/thread/3b885d3fe5bb21a5?pli=1 (Tim's post, it's the 8th from the top)
Answered by: Gianna965 | Posted: 26-02-2022Answer 2
Might be worth checking that the error isn't due to something outside the file:
Make sure the package name you are using in your schema URI, "org.ifies.android", matches the value of the package attribute on the manifest element in AndroidManifest.xml.
Make sure res/values/attrs.xml has the attributes specified:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="com.admob.android.ads.AdView">
<attr name="testing" format="boolean" />
<attr name="backgroundColor" format="color" />
<attr name="textColor" format="color" />
<attr name="keywords" format="string" />
<attr name="refreshInterval" format="integer" />
<attr name="isGoneWithoutAd" format="boolean" />
</declare-styleable>
</resources>
Answered by: Haris701 | Posted: 26-02-2022
Similar questions
Testing GPS in Android
How do you test GPS applications in Android? Can we test it using the Android emulator?
unit testing - Why do I get a Illegal Access Error when running my Android tests?
I get the following stack trace when running my Android tests on the Emulator:
java.lang.NoClassDefFoundError: client.HttpHelper
at client.Helper.<init>(Helper.java:14)
at test.Tests.setUp(Tests.java:15)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:164)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:151)
at android.test.InstrumentationTestRunner.onStart(Instrume...
unit testing - Android: test suite
I have realize different tests extending the "ActivityInstrumentationTestCase2".
Now, I want to structure my tests: group them and be able to run a subset.
How to do this?
Can I use the TestSuite class?
Any idea?
Regards,
Alban.
Testing FPS using Android plugin for Eclipse?
Ive no doubt this question may have been addressed before but how can I turn on a framerate monitor to use when I run my programs using the android emulator so I can see exactly what my android game is achieving at a given time?
Android app unit testing
So, I'm new to android unit testing. I'm trying to write a unit test for the Phone application:
package com.android.phone;
import android.content.Intent;
import android.net.Uri;
import android.test.ApplicationTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import com.android.phone.PhoneApp;
import dalvik.annotation.TestTargetClass;
@TestTargetClass(PhoneApp.class)
public class TestPhon...
Hit testing on a MapView, Android
I hava a MapView and I define a Rect. Touching the map I compare the coordinates to detect whether the rect is touched or not. But it does not work
RectF hitTestRecr = new RectF();
hitTestRecr.set(0,100,0,100);
hitTestRecr.offset(0,0);
if (hitTestRecr.contains(event.getX(),event.getY())) {
Toast.makeText(getBaseContext(), "hit", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(getBaseContext(), "...
unit testing - Access image in my Android Tests
I am working on an Android app. It has corresponding spec/test application. As part of some of my tests, I need to pick up an image from my assets folder and calculate SHA-1 for it.
I can calculate SHA, as long as I can pick the image. Since the tests run on emulator; I am not sure how to pick the image in my test.
Does anyone have any idea, how I can go about it. With and without AssetManager maybe? Any ideas wil...
Live Testing of the Android LVL
I have a paid app that's been out in the Android Market for a few months now, and up to this point that app had no type of copy protection or license verification scheme.
I have just finished adding an modified version of the LVL code to my app. To test out the code's license response handling, I signed into my dev account on the emulator and went through all of the test responses successfully, and then did the sam...
unit testing - JUnit in android
I am familiar with JUnit testing in android..
My Question is if we are using calculator and we want to test addition operation..To test the addition operation if we are using more number of test cases(for example 30). instead of rewriting the test cases for 30 times, is there any generic way to do this or is there any way to take the test cases form excel sheet or xml file..?
Please let me know is there any better ...
Testing my Java/Android app - is my setup wrong?
I just tried to test my first android app using the emulator, it crashed (as expected). So I load the debug view in Eclipse and now I'm not really sure what I'm looking for...
I see a tab that within the first thread I see a bunch of executions (i guess that's the right word) and they say: Source not found. and has a button that reads Edit Source Lookup Path...
Is there something ...
Still can't find your answer? Check out these communities...
Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android