Sam
unread,Mar 29, 2011, 10:40:17 PM3/29/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google AdMob Ads Developers
Hello all
I recently added admob ads to my android app. After an hour or two of
trying to figure out how to make the dang code work, I finally got it
to work on my emulator. I didn't know it would be different for the
released version so I published my app's update. But the ads don't
show up on the published version of the app! Am I just not waiting
long enough? I am getting requests (680 so far) but the only revenue
I've gotten is the times I've tested my app on the emulator.
My code:
On the .java:
//Create the adView
AdView adView = new AdView(this, AdSize.BANNER, "xxxxxxxxxxx" );
// Lookup your LinearLayout assuming it’s been given
// the attribute android:id="@+id/mainLayout"
LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayout);
layout.addView(adView);
// Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());
On my manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|
orientation"/>
<meta-data android:value="xxxxxxxxxxxx"
android:name="ADMOB_PUBLISHER_ID" />
</application>
On my XML:
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/mainLayout"></
LinearLayout>
Thanks in Advance,
Sam