Android apk Two-pack placement AD

Source: Internet
Author: User

We take helloword.apk as an example, anti-compilation implanted with rice ads.

First, we use the APK to change the rationale, Decompile helloworld.apk.

Then follow the development document with the rice to advertise the placement. Http://static.youmi.net/files/sdk/YoumiSdk_v4.04_2013-07-12.zip

Steps:

1. Apply for AppID (Ignore )

2. Importing the SDK

Anti-compilation, with the meter SDK,the demo directory under the apidemo.apk.

3. Configure Androidmanifest

3.1 Configuring User Rights (important )

Press the document to copy the permissions into the Helloword androidmanifest.xml.

3.2 Add Required Components (important)

Copy the components into Helloword's androidmanifest.xml according to the documentation

Complete the above steps and our SDK has been implanted successfully.

Take an example of a rice ad strip call. Let's start by adding ad code.

According to the documentation, we add the code to the layout file of the activity to display the ad , and put it in the appropriate location.

Open Layout/activity_main.xml and add layout code.

A new id "adlayout" is added here, and we need to write this ID manually into Com/example/helloworld/r$id.smali. Note that the 16-bit value here is incremented.

After the layout file has been modified, we call the ad interface in Mainactivity's OnCreate method to display the ad.

We write the following code into Android project.

Then decompile the corresponding Smali code.

Add the Initad () corresponding Smali code to mainactivity and call Initad () in the OnCreate () method to display the advertisement. (Invoke-direct {P0}, Lcom/example/helloworld/mainactivity;->initad () V

Finally, compile the code to generate the apk. (Top navigation, compile-to-build apk ), install the generated apk (top navigation ->adb-> Install the generated apk).

Before and after code implantation.

More content, look forward to your exploration, please pay attention to love encryption, so you wonderful constantly!

Love encryption official Address: Http://t.cn/RzUn7DF

Android apk Two-pack placement AD

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.