I found this code to get overall cpu usage. is this possible to convert this to tell cpu usage by process? Is there any API by which we can get CPU or Memory usage of android?>
Read /proc/[pid]/stat - [pid] is your target process's pid
Then look for the following members.
man /proc @ http://linux.die.net/man/5/proc