0

Okay I made a lot of research before I came here (sorry for my english).

My problem is : I made an application and I implement Admob 4.3.1 (my application is developped on Android 3.2 (with eclipse).

First time I was having the error "You must have INTERNET and ACCESS_NETWORK_STATE permission, I put them on my AndroidManifest.xml, now all is okay but when I start my application, my ads are not showing up.

I hope you can help me soon... thank you very much.

Here is my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.package.sound"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>

<application
    android:icon="@drawable/gg"
    android:label="@string/app_name" >
    <activity
        android:name=".testpackagesound"
        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=".test1"
        android:label="@string/app_name" >
        </activity>
    <activity
        android:name=".test2"
        android:label="@string/app_name" >
        </activity>
    <activity
        android:name=".test3"
        android:label="@string/app_name">
        </activity>
        <meta-data android:value="xxxxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID" />
        <uses-sdk android:minSdkVersion="7" />
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
</manifest>

Here is my Layout :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/image"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads">

<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >


<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:text="test1"
    android:textColor="#005113" />


<Button
    android:id="@+id/button3"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:text="test2"
    android:textColor="#970000" />





<Button
    android:id="@+id/button2"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:text="test3"
    android:textColor="#001760" />

</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dip" >

<com.google.ads.AdView
    android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    ads:adSize="BANNER"
    ads:adUnitId="xxxxxxxxxx"
    ads:loadAdOnCreate="true" >
</com.google.ads.AdView>


</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fillViewport="true" >
<LinearLayout 
android:layout_width="300px"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_gravity="center_horizontal"
>
<Button
android:id="@+id/button4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="test4" />
   <Button
android:id="@+id/button18"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="test18" />

</LinearLayout>
</ScrollView>
</LinearLayout>
user2864740
  • 60,010
  • 15
  • 145
  • 220
dealswiss
  • 15
  • 3
  • The code looks ok; I don't think the SDK uses the ADMOB_PUBLISHER_ID, but that shouldn't have any affect. Check the logcat output and see what kind of messages the SDK is giving you. – Eric Leichtenschlag Jan 31 '12 at 17:46

2 Answers2

0

So basically the only thing I can think of is that you missed something in your layout.xml file. Here's some example that might help you:

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
   //............Some other views
<com.google.ads.AdView android:id="@+id/adView"
                       android:layout_width="wrap_content"
                       android:layout_height="wrap_content"
                       android:layout_centerInParent="true"
                       ads:adUnitId="Your Add ID"
                       ads:adSize="BANNER" 
                       ads:loadAdOnCreate="true"/>
   //Some other views

If I'm not wrong you either forgot line 3 or you don't have a correct add id. Hope this helps you.

If this doesn't help you take a look over the official android addmob documentation or maybe here.

Also I hope you imported your AddMob libray to your project.

Community
  • 1
  • 1
Fofole
  • 3,398
  • 8
  • 38
  • 59
  • still not working, can i send you my layout ? cause i can not post it here because i am a new member. – dealswiss Jan 31 '12 at 10:13
  • Ok just click edit on your question and put it in the end it's easier. – Fofole Jan 31 '12 at 10:14
  • it's done. thank you a lot... i am trying to find a solution of this issue from 4 days now... – dealswiss Jan 31 '12 at 10:20
  • Check if you imported the admob library. Also you seem to have a duplicate of this lines xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" keep them just in your base,first linearlayout. – Fofole Jan 31 '12 at 10:24
  • Google AdMob ads SDK 4.3.1 is in my referenced librairies into my project... i deleted the duplicates lines now... same problem. is there any problem on the Site & apps website of Admobs ? i have to configure something on that ? – dealswiss Jan 31 '12 at 10:27
  • I don't think so. Don't you get any problems message,or anything in the errorLog? If not, the only thing I can think of is your id you put instead of XXXXXXXX is not good. This is as much as I can think of. – Fofole Jan 31 '12 at 10:31
  • no i get nothing on errorlog... Ok then i have to re-create the apps on Admobs ? After that i can publish my app on the android market ?! – dealswiss Jan 31 '12 at 10:33
  • 1
    MY PROBLEM IS SOLVED.... i don't see my own Ads on my app cause my phone is Rooted / ROM Flashed... – dealswiss Jan 31 '12 at 23:39
  • Nice to see you finnaly did it ;) Consider choosing an answer for your question or put yourself an answer for the question. – Fofole Feb 01 '12 at 06:49
0

Ads will not display if there is not enough room to in the layout. Check the logcat log for any and all ad related messages. See this Admob ads not showing - Android for suggestions if this is the case.

Community
  • 1
  • 1
eyespyus
  • 1,576
  • 19
  • 20