android - How to measure time elapsed of another app? (in low memory situations) -


i making application launches games (apps not made me), , have measure time elapsed of each game session business requirement.

however, app killed if large game launch , low memory occurs.

i have tried start long-running service, runs handler monitoring package name of foreground activity, , keep service running @ least long game launched returning start_sticky, using startforeground(), running on separate process, no luck.

i tried send broadcast in ondestory(), not called.

i have platform signature , can have app run system app adding android:shareduserid="android.uid.system", help?

or there better approach measurement? thanks!


Comments