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