Hi, I want to detect the currently executing foreground app. If the foreground app is say "email" then perform some tasks. I tried doing this from within the android frame work. However, the only way to do it is using Activity Manager and checking the running tasks periodically from a background service. However, running this background service periodically will not be good as it will consume battery and might hog the cpu if the check period is low.
Instead of doing it from the android framework, is there any way I can do this from within the kernel? I can check the list of tasks in the run-queue. I can also check what task is being context-switched in. However, even while an app is running it will be getting context- switched in and out. Hence I will have to differentiate the context- switch in for the first time and the context-switches occurring during the execution of the application. Can anyone give me some feedback on this. Thanks. -- unsubscribe: [email protected] website: http://groups.google.com/group/android-kernel
