I’m hoping to write a tweak to record all activities running on a rooted Android phone. For example, I want to record the information such as:
- 2012-07-31 15:03 app1:Activity01:onCreate()
- 2012-07-31 15:04 app1:Activity01:onStart()
- …
- 2012-07-31 15:05 app1:Activity01:onPause()
- 2012-07-31 15:05 app2:Activity01:onResume()
Is is possible to do it? If so, please kindly tell me where to find the related information, books or domain knowledge I should study to accomplish this task. I’m new on Android programming but familiar with C++ and Java.
Thanks a lot!
Each Android app is executed in its own process running its own instance of the Dalvik VM. The VM normally does not provide the information you are looking for across process boundaries.
If you feel like really hacking your Android you could investigate into these two approaches:
Bottomline: Rooting your phone is child’s play compared to those hacks.
However, I would advise against trying to ‘hook’ into Android the way you described, both for performance and stability reasons.