Ad test problem in app with AdMob

by erick nicolas » Thu, 22 Oct 2009 02:03:47 GMT


Sponsored Links
 i,

I've got a problem with my Android app. It doesn't show test ad and I
don't understand why.

Here is my java code:

package org.ifies.android;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import com.admob.android.ads.AdManager;
import com.admob.android.ads.AdView;

public class AdmobExample extends Activity{
private TextView example_message;
private AdView example_adview;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.main);

example_adview = (AdView) findViewById(R.id.ad);
example_adview.setVisibility(AdView.VISIBLE);

example_message = (TextView) findViewById(R.id.example_message);
example_message.setVisibility(TextView.VISIBLE);
// example_message.setText("This is an example of AdMob for
Android");

}
}

Here my xml layout

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/org.ifies.android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom">

<TextView
android:id="@+id/example_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_weight="1" />

<com.admob.android.ads.AdView
android:id="@+id/ad"
android:visibility="gone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:backgroundColor="#FFFFFF"
app:textColor="#000000"
app:keywords="Android game"

app:testing="true"
/>

</LinearLayout>

Here is the AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.ifies.android"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/
app_name">
<activity android:name=".AdmobExample"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:value="a14adf472974adb"
android:name="Test" />
</application>
<uses-sdk android:minSdkVersion="2" />
<uses-permission android:name="android.permission.INTERNET" />

</manifest>

And here is the logcat when app starts

10-21 17:57:25.064: INFO/AdMob SDK(722): The user ID is null
10-21 17:57:25.124: DEBUG/AdMob SDK(722):



Ad test problem in app with AdMob

by erick nicolas » Thu, 22 Oct 2009 02:05:00 GMT


 i,

I've got a problem with my Android app. It doesn't show test ad and I
don't understand why.

Here is my java code:

package org.ifies.android;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import com.admob.android.ads.AdManager;
import com.admob.android.ads.AdView;

public class AdmobExample extends Activity{
private TextView example_message;
private AdView example_adview;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.main);

example_adview = (AdView) findViewById(R.id.ad);
example_adview.setVisibility(AdView.VISIBLE);

example_message = (TextView) findViewById(R.id.example_message);
example_message.setVisibility(TextView.VISIBLE);
// example_message.setText("This is an example of AdMob for
Android");

}
}

Here my xml layout

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/org.ifies.android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom">

<TextView
android:id="@+id/example_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_weight="1" />

<com.admob.android.ads.AdView
android:id="@+id/ad"
android:visibility="gone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:backgroundColor="#FFFFFF"
app:textColor="#000000"
app:keywords="Android game"

app:testing="true"
/>

</LinearLayout>

Here is the AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.ifies.android"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/
app_name">
<activity android:name=".AdmobExample"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:value="a14adf472974adb"
android:name="Test" />
</application>
<uses-sdk android:minSdkVersion="2" />
<uses-permission android:name="android.permission.INTERNET" />

</manifest>

And here is the logcat when app starts

10-21 17:57:25.064: INFO/AdMob SDK(722): The user ID is null
10-21 17:57:25.124: DEBUG/AdMob SDK(722):


Sponsored Links


Ad test problem in app with AdMob

by Wayne Wenthin » Thu, 22 Oct 2009 06:33:08 GMT


 he first two lines of the Logcat output pretty much sum it up:10-21
17:57:25.064: INFO/AdMob SDK(722): The user ID is null
10-21 17:57:25.124: DEBUG/AdMob SDK(722): Publisher ID read from
AndroidManifest.xml is null

The user ID is null. I'm assuming that it must be put in the
AndroidManifest.xml based on the second line.

On Wed, Oct 21, 2009 at 11:03 AM, erick nicolas <ericknico...@gmail.com>wrote:



--
Writing code is one of few things
that teaches me I don't know everything.

http://www.fuligin.com

--~--~---------~--~----~------------~-------~--~----~



Ad test problem in app with AdMob

by erick nicolas » Fri, 23 Oct 2009 00:18:11 GMT


  solve it!
The problem wan in AndroidManifest.xml in line
Code :
<meta-data android:value="a14adf472974adb" android:name="Test" />

Test is my AdMob campain name and here is the attribute name from
publisher id.

Here is the correct line
<meta-data android:value="a14adf472974adb"
android:name="ADMOB_PUBLISHER_ID" />

Thnkx

On Oct 22, 12:32am, Wayne Wenthin <wa...@fuligin.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Ad test problem in app with AdMob

by Steve » Fri, 23 Oct 2009 00:34:54 GMT


  always use ADMOB_PUBLISHER_ID as the publisher ID (not "test"), and
since you have 2 errors related to an empty user id, that might be
worth trying.

<!-- The application's publisher ID assigned by AdMob -->
<meta-data android:value="a14adf472974adb"
android:name="ADMOB_PUBLISHER_ID" />

Also it might be bette to post this question to AdMob's publisher
group at

http://groups.google.com/group/admob-publisher-discuss


On Oct 21, 11:03am, erick nicolas <ericknico...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Ad test problem in app with AdMob

by Mike » Fri, 23 Oct 2009 23:50:53 GMT


 rick,

Feel free to come on over to the admob-publisher-discuss group at
http://groups.google.com/group/admob-publisher-discuss for any AdMob
related questions you may have. We monitor that group a little more
closely and will be able to help you there.

I see a couple of other things you could change in your layout file,
all of the admob attributes for setting things such as text color or
background color for the ad are preceded by an "admob:". For example:

<com.admob.android.ads.AdView
android:layout_width="320px"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content"
admob:backgroundColor="#FFFFFF"
admob:primaryTextColor="#000"
admob:testing="true"
/>

Mike
--
AdMob

On Oct 22, 9:17am, erick nicolas <ericknico...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Populating a database efficiently

Hi all,
It currently takes my onCreate method 147 seconds to create and populate my
database, if anyone with a better knowledge of SQLite could help me reduce
this it would be greatly appreciated.

I have want to create a database with three tables;


   1. CREATE TABLE "nodeConfigurations" ("nodeId" INTEGER PRIMARY KEY
    AUTOINCREMENT  NOT NULL , "filterId" INTEGER NOT NULL , "left" INTEGER NOT
   NULL , "right" INTEGER NOT NULL , "type" INTEGER NOT NULL , "parameters"
   TEXT);
   2. CREATE TABLE "data" ("dataId" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT
   NULL , "dataName" TEXT NOT NULL );
   3. CREATE TABLE "nodes" ("nodeId" INTEGER PRIMARY KEY  NOT NULL ,
   "nodeType" TEXT NOT NULL );

These three lines are stored in a file under the raw directory, one command
on each line.

I have data to insert of the form;

   1. 24 x INSERT INTO "nodes" VALUES(1,'type');
   2. 1000 x INSERT INTO "data" VALUES(1,'name');
   3. 13589 x INSERT INTO "nodeConfigurations" VALUES(1,1000,5,6,1,'[]');

These 14614 separate insertion commands are stored one on each line in
another file in the raw resource directory.

My database helper is defined thus;

public class DBHelper extends SQLiteOpenHelper {
        ....
public void onCreate(SQLiteDatabase db) {
this.db = db;
long start = System.currentTimeMillis();
try{
Scanner sql = new
Scanner(context.getResources().openRawResource(R.raw.database_schema));

db.beginTransaction();
while(sql.hasNextLine()){
String command = sql.nextLine();
db.execSQL(command);
}
db.endTransaction();
 sql = new
Scanner(context.getResources().openRawResource(R.raw.database_data));

db.beginTransaction();
while(sql.hasNextLine()){
String command = sql.nextLine();
db.execSQL(command);
}
db.endTransaction();

}catch (Throwable t) {
Toast.makeText(context, "Exception: "+t.toString(),2000).show();
Log.w("FilterDB", "Database initialization failed");
t.printStackTrace();
}

Log.i("FilterDBHelper","Database created in " + (System.currentTimeMillis()
- start) + " Milliseconds");
}
       ....
}


Checking the log I can see that the creation and inserts took a
whopping 147seconds.... I must be doing something wrong.

02-20 15:42:37.703: INFO/FilterDBHelper(281): Database created in 147844
Milliseconds


Any advice would be greatly appreciated!

Kind regards,

Gavin

--~--~---------~--~----~------------~-------~--~----~

2. After install ADT0.9,failed to launch APP as no VM compatible with android 1.5

You need create one vm firstly, then launch emulator with that vm.







--~--~---------~--~----~------------~-------~--~----~

3. *** Why 1 G1 can see Paid Apps in the Android Market and Another Not? ***

4. App Store Listings (Pictures?)

5. develop application without a data plan?

6. Question about spinner and quick text search.

7. how to switch between two views