asdsad
Getting Started with AdMob Android Ads This page will help you get started with becoming a publisher for AdMob Android Ads.
Learn about AdMob Android ads AdMob Android ads are a turnkey ad unit for monetizing Android Apps The ad dimensions on the T-Mobile G1 are: 320 pixels wide x 48 pixels tall Sign up with AdMob
-
Register or login at admob.com, and click 'Sites & Apps".
-
Click "Add Mobile Site", and provide the info for your Android App.
-
Once you've added your site, click "Install Code". You should see a button to download the Android SDK.
-
The download includes the binaries, documentation, and a sample.
-
Review README.txt
-
Read documentation/index.html which details how to integrate AdMob ads into your application
-
Look at the Lunar Lander sample project to see a working example AdMob Android SDK The AdMob Android SDK contains the code necessary to install AdMob ads within your application.
SDK Integration Instructions (1) In your project's root directory create a subdirectory libs. This will already be done for you if you used Android's activitycreator tool. Copy the AdMob Jar file into that libs directory.
For Eclipse projects:
Go to the Properties of your project (right-click on your project from the Package Explorer tab and select Properties) Select "Java Build Path" from left panel Select "Libraries" tab from the main window Click on "Add JARs..." Select the JAR copied to the libs directory Click "OK" to add the SDK to your Android project (2) Add your publisher ID to your AndroidManifest.xml . Just before the closing tag add a line to set your publisher ID. If you publisher ID were, “a149afxxxx”, the line would look like this:
(3) Add the INTERNET permission to your AndroidManifest.xml just before the closing tag:
(4) Paste the following into your attrs.xml file:
<resources>
<declare-styleable name="com.admob.android.ads.AdView">
<attr name="backgroundColor" format="color" />
<attr name="primaryTextColor" format="color" />
<attr name="secondaryTextColor" format="color" />
<attr name="keywords" format="string" />
<attr name="refreshInterval" format="integer" />
</declare-styleable>
</resources>
(5) Create a reference in to the attrs.xml file in your layout element by adding xmlns line that includes your package name specified in AndroidManifest.xml. For example, if your package name were com.example.SampleApp, you would include this line:
xmlns:myapp="http://schemas.android.com/apk/res/com.example.SampleApp" So for a simple screen with only one ad, your layout element would look like this:
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"
/>
(6) When integrating AdMob ads into your application it is recommended to use test mode. In test mode test, ads are always returned.
Test mode is enabled on a per-device basis. To enable test mode for a device, first request an ad, then look in LogCat for a line like the following:
To get test ads on the emulator use AdManager.setTestDevices... Once you have the device ID you can enable test mode by calling AdManager.setTestDevices:
AdManager.setTestDevices( new String {
AdManager.TEST_EMULATOR, // Android emulator
"E83D20734F72FB3108F104ABC0FFC738", // My T-Mobile G1 Test Phone
} );
}
Once you’ve successfully requested test ads, try clicking on each type of test ad to make sure it works properly from your application. The type of test ad returned is changed with AdManager.setTestAction.
FAQ Q: I think I've done everything correctly, but I'm not seeing any ads. What's up with that?
A: You should be seeing a "DidRequestAd" message in your application log. This means that an ad request was made to AdMob, but there was no matching ad to serve in your application. Your integration should be working, and there's nothing else you need to do. If this doesn't work, try the following:
-
Request an ad in test mode.
-
Double-check that your publisher id is set correctly and try again.
-
For the SDK, check whether the included sample projects displays ads. If it does, you might want to check that you are displaying the ad correctly on screen.
-
Confirm that there are ads available for your site by logging in to www.admob.com.
-
Also, the very first request to the AdMob adservers can sometimes take a while; if all else fails, wait 5-10 minutes and try again.
-
If this still doesn't work, email support@admob.com.
Q: Where does the market URL come from?
A: The Android Market URL for your application will be http://market.android.com/search?q=pname: followed by your application's classpath. For example: http://market.android.com/search?q=pname:com.example.ExampleApp
Retrieved from "http://developer.admob.com/wiki/Android"