Step 1
You need a adMob account.
You are going to adMob page and create an account.
If already have an account, need a log in.
You can be seen to below image, if you log in first time.
This is important!!!
'Country' is choose your country.
'Account Type' choose your type.
'Business Name' typing your company name or your name.
And choose received pay type. ACH/Wire or PayPal.
If you choose ACH/Wire, you receive when earn over $100 but you choose PayPal, you receive when earn over $20.
If you Korean, you can reference 'Bank SWIFT Code' to this site.
Step 2
You log in adMob and click to' Add Site/App' in 'Sites&Apps' tab.
And choose Android App ,you can be seen to below image.
Need a fill.
'App name' is your app name.
'Android package URL' is your app market's URL. If you don't have a market URL , just typing http://
'Category' is app's category.
'App descriptions' is your app description.
'Other Google Ads' is choose ad method. maybe first is good method.
And click to 'Continue' after fill a secret number.
Step 3
You download SDK.
Unzip SDK and Open your eclipse project.
Copy 'GoogleAdMobAdsSdk-6.4.1.JAR' in zip file to android project libs folder.
JAVA file
- import com.google.ads.AdRequest;
- import com.google.ads.AdView;
- ....
- public class MainActivity extends Activity implements OnClickListener,OnItemSelectedListener {
- AdView adView;
- .............
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- AdView adView = (AdView)this.findViewById(R.id.adView);
- adView.loadAd(new AdRequest());
- .............
- }
- ................
- }
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context=".MainActivity" >
- <com.google.ads.AdView
- android:id="@+id/adView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- ads:adUnitId="your KEY"
- ads:adSize="SMART_BANNER"
- ads:loadAdOnCreate="true"/>
AndroidManifest.xml
- .........
- <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|screenLayout|uiMode|screenSize|smallestScreenSize" />
- </application>
- .....
This image is running app.
You can be seen to add adMob in your app.
No comments:
Post a Comment