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 ());