I am writing an Android code segment to help tracing Android event as a service tool for app developers.
For example, the main app body can be just to display 'hello world'. My code will listen to the app event, such as onStart()
, onResume()
, onDestroy()
, etc, and keep a trace on these events.
Certainly, the code can be inserted directly under the main activity. But that means my code will be allover the places. Is there a way, I can create an object (i.e., a listener), and only request the app developer to add 1~2 liner to use my code?