Extremely basic Android project demonstrating Aspect Oriented Programming.
- Checkout the source
- Build and deploy to a device or emulator with
./gradlew installDebug
- Observe the logcat output as you press the buttons
The MetricsAspect
class contains a method that is configured to run whenever an onClick
method is called within the project's package.
From the Aspect method it is possible to access the View
argument passed to the onClick
method along with other useful information about the current execution context.
The classes have been kept as simple as possible to make it simple to understand what is happening.