Monkytalk Learning -8-agent

Source: Internet
Author: User

A lot of features about ASPECTJ have been configured before, but it has not been used because all of my previous studies have been run on a demo apk and this demo is already configured.

Try writing your own project and learning how to add an agent.

1. First create an Android project, write a few activity, here simply write two activity, one is login, one is main,login responsible for login, main is responsible for displaying the logged in user, and processing logout function. Similar to the previous Demo1.

2. Convert Android Project to ASPECTJ

Right click on Android project, select Configure----Convert to AspectJ project (this option should be available here if the previous configuration is complete)

Note: Once the convert is made, whether or not it succeeds, the project becomes AJ, and if not successful, only re-create a project (possibly I will not use, after all first contact ASPECTJ)

After success, the ASPECTJ Runtime Library directory will appear

2. Agent Additions

Locate Agent.jar in the directory of the installation package, and copy it to the Libs directory in the Android project, if this directory is not created.

3. Add to Aspectpath

After adding the agent, select the Agent.jar, then---AspectJ Tools----add to Aspectpath

After success, the referenced libraries directory appears in Android engineering,

4. Right-click the Android project name----Properties----Order and Export----tick AspectJ Runtime Library

5. Change the androidmainfest.xml.

<android:name= "Android.permission.INTERNET"/><   android:name= "Android.permission.GET_TASKS"/>

Interent is used to connect the IDE and the app,

Get_tasks is a program that allows programs to get apps.

6. Complete.

The settings that need to be modified on Android engineering to this step are complete.

Install to the simulator or phone.

7. Connecting the IDE and the emulator

When the app is launched, when the Record button is activated, it means that the two are connected. Once activated, it is easy to record and play back.

Monkytalk Learning -8-agent

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.