[Android Software Development] cmoney12051:
for the life of me i cannot get the ads to display. i have it all set so it shows the space for them, but tit will not display an ad. my code is posted below

java file

package com.cmoney12051.helpcenter;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.util.Random;

import com.facebook.android.*;
import com.facebook.android.Facebook.*;
import com.google.ads.*;

import android.app.Activity;
import android.app.AlertDialog;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.RemoteViews;
import android.widget.TextView;

import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;

public class WebViewTemplate extends Activity {
private WebView myWebView;
/** Called when the activity is first created. */
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && myWebView.canGoBack()) { // Enables browsing to previous pages with the hardware back button
myWebView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
setContentView(R.layout.main);

// Lookup R.layout.main
AdView layout = (AdView)findViewById(R.id.ads);

// Create the adView
// Please replace MY_BANNER_UNIT_ID with your AdMob Publisher ID
String pubID ="xxxxxxxxxxxxxxx";
AdView adView2 = new AdView(this, AdSize.BANNER, pubID );

// Add the adView to it
layout.addView(adView2);

// Initiate a generic request to load it with an ad
AdRequest request= new AdRequest();
request.setTesting(true);
adView2.setVisibility(AdView.VISIBLE);
adView2.loadAd(request);

myWebView = (WebView) findViewById(R.id.webview); // Create an instance of WebView and set it to the layout component created with id webview in main.xml
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.loadUrl("http://cmoney12051.com/HelpCenter/mobile.php"); // Specify the URL to load when the application starts
//myWebView.loadUrl("file://sdcard/"); // Specify a local file to load when the application starts. Will only load file types WebView supports
myWebView.setWebViewClient(new WebViewKeep());

myWebView.getSettings().setBuiltInZoomControls(true); // Initialize zoom controls for your WebView component
myWebView.getSettings().setUseWideViewPort(true); // Initializes double-tap zoom control

}

private class WebViewKeep extends WebViewClient {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}

}

public boolean onCreateOptionsMenu(Menu menu)
{
super.onCreateOptionsMenu(menu);

MenuItem item = menu.add("Login");
item.setIcon(R.drawable.login);

item = menu.add("Register");
item.setIcon(R.drawable.register);

item = menu.add("Email Cmoney");
item.setIcon(R.drawable.email);

item = menu.add("Share on Facebook");
item.setIcon(R.drawable.facebook_icon);

item = menu.add("Donate");
item.setIcon(R.drawable.donate);

item = menu.add("Exit");
item.setIcon(R.drawable.exit);
return true;

}

public boolean onOptionsItemSelected(MenuItem item)
{

if (item.getTitle() == "Exit"){

android.app.AlertDialog.Builder builder = new AlertDialog.Builder(this);

builder.setTitle("Exit?");

builder.setIcon(R.drawable.exit);

builder.setMessage("Are you sure you want to exit?");

builder.setPositiveButton("ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
System.exit(0);
}
});

builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});

builder.show();

}

if (item.getTitle() == "Login"){
myWebView.loadUrl("http://cmoney12051.com/HelpCenter/ucp.php?mode=login");

myWebView.setWebViewClient(new WebViewKeep());

}
if (item.getTitle() == "Register"){
myWebView.loadUrl("http://cmoney12051.com/HelpCenter/ucp.php?mode=register");

myWebView.setWebViewClient(new WebViewKeep());

}
if (item.getTitle() == "Email Cmoney"){

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

String aEmailList[] = { "chaz1429@gmail.com" };

emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, aEmailList);

emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "A Message From Cmoneys Android Help Center App");

emailIntent.setType("plain/text");

startActivity(Intent.createChooser(emailIntent, "Send your email in:"));

}

if (item.getTitle() == "Share on Facebook"){

myWebView.loadUrl("http://www.facebook.com/sharer.php?u=http://cmoney12051.com/HelpCenter&t=Cmoneys%20Android%20Help%20Center&refsrc=http://m.facebook.com/sharer.php");

myWebView.setWebViewClient(new WebViewKeep());

}

if (item.getTitle() == "Donate"){

myWebView.loadUrl("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GDB6U44B67FXU");

myWebView.setWebViewClient(new WebViewKeep());
}

return true;
}

}

Main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout	xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.ads.AdView
android:layout_width="fill_parent"
android:layout_height="60px"
android:layout_alignParentTop="true"
android:visibility="visible"
android:id="@+id/ads">
</com.google.ads.AdView>
<TableRow android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/tableRow1">
<ImageView android:id="@+id/logo"
android:src="@drawable/logo"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
</ImageView>
<TextView android:text="Cmoneys Android Help Center"
android:id="@+id/textView1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textStyle="bold"
android:textSize="30px">
</TextView>
</TableRow>
<DigitalClock android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/digitalClock1" android:text="DigitalClock"></DigitalClock>

<WebView
android:id="@+id/webview"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:focusableInTouchMode="true">
</WebView>

</LinearLayout>

Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="2"
android:versionName="1.1" package="com.cmoney12051.helpcenter">
<application android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar" android:icon="@drawable/logo">
<activity android:name=".WebViewTemplate"
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.AdView"
android:configChanges="keyboard|keyboardHidden|orientation"/>

<meta-data android:value="xxxxxxxxxxxxxx" android:name="pubID" />
<meta-data android:value="true" android:name="AD_REQUEST" />
<meta-data android:value="false" android:name="TEST_MODE" />

</application>

<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>

Any Help Is Really Appreciated. Thanks anyway