AdMob advertising profit model detailed tutorial

Source: Internet
Author: User
Tags directory create valid email address admob

I saw a detailed tutorial on AdMob's advertising profit model on the Internet. It feels good. Hey, I moved it for your reference.

 

Before that, you don't need any account. The only thing you need is a valid email address. As long as you follow the steps below, you can make money by inserting the AdMob advertisement into your own program!


First, you must register an AdMob account. AdMob home page is: http://www.admob.com /.
Of course, if you still have some obstacles to browsing the English web page, you can log on to the Chinese website: http://zhcn.admob.com/
. If the website text is still in English, you can select "Chinese (simplified)" in the "language" area in the lower-right corner of the home page )". Click to enter the registration page, there are some columns to fill in, not too
Just like registering a forum, just fill it out. The most important thing is to ensure that the entered email address is valid. The other is to fill in the name and select the language. The Account type I selected is "not sure ",
The language is "Chinese (simplified )"~ After you submit a registration application, you will soon receive an email to confirm and activate your account. Click the activation link to activate your AdMob account ~

Step 2: Set your android application information and obtain the AdMob insertion code. After logging on to your AdMob account, click on the top left of the home page (above the logo)
"Marketplace (mobile advertising market)". After Entering the page, click "add" under the "sites & apps" tab.
Site/APP ". Select the familiar icon-"Android app"
. In this case, you need to enter a "details" and enter some information at will. (Do not care too much about what you enter, because these can be modified later ). For example, "android
Package URL "I haven't filled in yet, such as description. If you want to write it, write it. After filling in the details, click "continue" to go to AdMob android
The SDK download page is displayed. Download this SDK (of course, this is important ).
The AdMob Android SDK uplodes:
Readme: get started with AdMob Android ads!

AdMob JAR file: Required for Publishing ads. Follow the documentation
In javadoc/index.html and drop the AdMob JAR file into your project.
Sample projects: Examples of AdMob Android ads shown in the lunarlander application.

Step 3: Obtain the publisher ID corresponding to your application. On the download page, click "go to sites/apps" To Go To The Application Management page. At this time, you will find a prompt asking you to fill in the details in a prominent position on this page:
You need to fill in the technical contact details and payment preferences before we send any pending income.

We don't need to worry about it for the time being, because the money will be stored in our AdMob account. You can just fill it out when we need to withdraw the money, or when you want to fill it out. In the list below, select your application
Program and enter. This is the management interface of your application advertisement. There are many functions in it, so you can learn more about it later. Now we only need to know two things: one is the publisher.
Publisher ID. One is the state of your program. Publisher
ID is a 15-character string, and the state of your program should still be inactive ). The following is how to make it active.
Step 4
Code Writing-insert AdMob ads in your application. After the above steps, we have a section on the website, and now we have to enter the topic, how
Insert AdMob advertisement in the Android Application. If you are not forgetful, remember the AdMob Android SDK we downloaded earlier.
. Decompress it and see what is in it. The most important thing here is the package named "admob-sdk-android.jar". How AdMob loads ads
The code in the Android Application is integrated in this package. We need to import this package into our project when writing the program. In addition, there is a folder named
Open the corresponding index.html in the folder. It is a help document for AdMob Android SDK.
Under setup, there is a detailed and complete introduction to the method for inserting advertisements in your own applications. Here I will be lazy and refer ~

Including the jar


Add the JAR file encoded with the SDK to your android project as
External library. In your project's root directory create a subdirectory
Libs (this will already be done for you if you used Android's
Activitycreator). Copy the AdMob JAR file into that directory.
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
Note: first create a folder named "Libs" under the root directory of your project, and copy the most important thing "admob-sdk-android.jar" that was previously mentioned to it.

Androidmanifest. xml

Your AdMob publisher ID was given to you when creating your publisher
Account on www.admob.com before downloading this Code. It is
15-character code like a1496ced2842262. Just before the closing
</Application> tag add a line to set your publisher ID:

<! -- The application's publisher ID assigned by AdMob -->
<Meta-data Android: value = "your_id_here" Android: Name = "admob_publisher_id"/>
</Application>

Set any permissions not already included just before the closing </manifest> tag:

<! -- AdMob SDK permissions -->
<Uses-Permission Android: Name = "android. Permission. Internet"/>
<Uses-Permission Android: Name = "android. Permission. access_coarse_location"/>
</Manifest>

Only the Internet permission is required. Setting
Access_coarse_location (and/or access_fine_location) allows narrowly
Geo-targeted ads be shown.
Note that <meta-data
Android: value = "your_id_here" Android: Name = "admob_publisher_id"
/>, We only need to change it to "your_id_here ". The ID you need to fill in here is what we saw on our application management page on the AdMob website.
Publisher ID, and name = "admob_publisher_id" should not be changed. The program needs this key to find the corresponding value.

Attrs. xml


The attrs. xml file specifies custom adview attributes in XML Layout
Files. If your application does not already have
/RES/values/attrs. xml file then create one and copy-and-paste
Following into it. If you do have that file then just add
Declare-styleable element:

<? XML version = "1.0" encoding = "UTF-8"?>
<Resources>
<Declare-styleable name = "com. AdMob. Android. Ads. adview">
<ATTR name = "testing" format = "Boolean"/>
<ATTR name = "backgroundcolor" format = "color"/>
<ATTR name = "textcolor" format = "color"/>
<ATTR name = "keywords" format = "string"/>
<ATTR name = "refreshinterval" format = "integer"/>
<ATTR name = "isgonewithoutad" format = "Boolean"/>
</Declare-styleable>
</Resources>
That's nothing to say.

Placing an adview in a Layout


Adview widgets can be put into any XML layout now. The first step is
Reference attrs. XML in your layout element by adding an xmlns line that
Includes your package name specified in androidmanifest. xml:

Xmlns: yourapps = http://schemas.android.com/apk/res/yourpackage
For example a simple screen with only an ad on it wowould look like:

<? XML version = "1.0" encoding = "UTF-8"?>
<Linearlayout
Xmlns: Android = "http://schemas.android.com/apk/res/android"
Xmlns: admobsdk = "http://schemas.android.com/apk/res/com.admob.android.example"
Android: Orientation = "vertical"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent">

<Com. AdMob. Android. Ads. adview
Android: Id = "@ + ID/ad"
Android: layout_width = "fill_parent"
Android: layout_height = "wrap_content"
Admobsdk: backgroundcolor = "#000000"
Admobsdk: textcolor = "# ffffff"
Admobsdk: KEYWORDS = "Android Application"
/>

</Linearlayout>
There seems to be nothing to pay special attention to here. Pay attention to adding xmlns, And you can set a keywords here.

Test Mode


When you start integrating AdMob ads into your application it is
Recommended to use test mode. This always returns the same ad. Normal ad
Requests are not deterministic making it harder to be sure the ad View
Looks like you want (e.g. Ad requests can timeout or may not fill ).


Once the AD shows up as you need CT be sure to turn test mode off to get
Real ads. Never put your application into the Android Market with test
Mode Enabled.
Test mode can be enabled either by calling
Admanager. setintestmode (true) or by adding a "admobsdk: Testing =" true ""
Property to the ad in your xml layout (where "admobsdk" is the XML
Namespace for your application ).

Set Test
Mode is critical. Never be in the test
The Mode Program has been released, so it won't make any money ~! If admobsdk: Testing = "false" is not added to the adview attribute, it seems that the program is not
It is in test mode, but it is best to add it ~


Step 5 compile and run the program and activate the program. Compile and run your program. You can see the effect on the simulator ~ (Of course, your simulator needs to be able to access the Internet. How can you enable the simulator to access the Internet? Routing should be available directly
If you are not using a route, you may need to configure it. You can search for the specific method on the Internet and forget it ). If your application shows an advertisement, congratulations, your application will soon
AdMob is activated (it may take me less than an hour )!

Step 6: view the amount of money your application has earned on the AdMob website ~ "Mobile advertising market"-> "report"-> "site and application report ". Select your application and click "Create report" at the bottom of the page "~ OK. Make money ~
Finally, I uploaded an example project I wrote. You can download it for reference. In addition, my project uses advertisements as mobile devices and changes the default width and background of advertisements, hoping to play a leading role in how to place advertisements in applications.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.