[General Questions and Answers] Ozzy Ozmen:
Hi guys !..

i got one problem kinda big cause i never find solition untill 1 month i hope i can get correct answer from here.( only admob prolem )

My problem is i cant add admob to my project allways i get error about "unfortunely has stopped" after splash secreen.

My codes are ..

main.xml :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="ht t p:/ /schemas.android com/apk/res/android" //for link error by this website
xmlns:ads="h t tp:/ /schemas.android com/apk/lib/com.google.ads" //for link error by this website
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="match_parent" >

<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="MY_AD_UNIT_ID"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR"
ads:loadAdOnCreate="true"/>
</RelativeLayout>

Main.java file

package com.example.proje;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;

/**
Ozzy Ozmen Celik
*/
public class Anasayfa extends Activity {
private WebView mWebView;

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

// Webview
mWebView = (WebView) findViewById(R.id.WebView);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebViewClient(new wapWebViewClient());
mWebView.loadUrl("adress");

}

private class wapWebViewClient extends WebViewClient {

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}

@Override
public void onPageFinished(WebView view, String url) {
// when the page loaded splash screen has been invisible
mWebView.setVisibility(View.VISIBLE);
}

@Override
public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl) {
// if any error occured this message will be showed
Toast.makeText(Anasayfa.this, "Pls try again later...." + description, Toast.LENGTH_LONG).show();
}
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
// setting of back button
mWebView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}

Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="h tt p : / /schemas.android com/apk/res/android"
package="com.example.proje"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" >
</uses-permission>

<application android:icon="@drawable/icon" android:label="@string/app_name">

<activity android:name=".Giris"

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=".Anasayfa"

android:label="@string/app_name">

<intent-filter>

<action android:name="com .example.proje.Anasayfa" />

<category android:name="android.intent.category.DEFAULT" />

</intent-filter>
</activity>

<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>

</manifest>

String.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Proje</string>
<string name="admob">admob</string>
<string name="reklam">reklam</string>
<string name="ad">ad</string>
<string name="adView">adView</string>
</resources>

google admob mobile ad java is "GoogleAdMobAdsSdk-6.4.1.jar"