How to Make money using mobile phones-AdMob

Source: Internet
Author: User
Tags admob

Want to make money by using a mobile phone? If you areProgramPersonnel, then put AdMob ads in the Android software. It is actually very simple. Follow these steps:

1. log on to http://zhcn.admob.com/chinese website to register an account or use a Google account. I am using a Google account

Click

Enter the application name and package name as prompted. Enter the site and Application

Click Manage settings to copy the publisher ID for backup.

2. Add the AdMob jar package to download the backup

 

Open eclispe or other development tools such as intellij idea. I am using idea

Open Idea and open the project. Right-click the project name and choose Open Module Settings

Click

Click OK

Open androidmanifest. xml of the project and add it to the application node.

<Activity Android: Name = "com. Google. Ads. adactivity"
Android: configchanges = "keyboard | keyboardhidden | orientation"/>

Add in the manifest Node
<Uses-Permission Android: Name = "android. Permission. access_network_state"/>
<Uses-Permission Android: Name = "android. Permission. Internet"/>
<Uses-Permission Android: Name = "android. Permission. read_phone_state"/>

Open the layout file main. xml

Replace my_ad_unit_id with the ID of the publisher just copied

Open the activity source file and add

Import com. Google. Ads. *; and
Adview = (adview) This. findviewbyid (R. Id. adview );
Adview. loadad (New adrequest ());

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.