Are you doing this programmatically? You want to do what the 'ps' shell program does: look in /proc to see the PIDs of all running processes. Each directory entry that corresponds to a process (e.g. /proc/1037 for PID 1037) is owned by the UID under which the process is running.
Note that knowing the UID might not uniquely identify a single process that is hosting the application, because an application can spread its components across multiple processes, all of which run under the same UID.
--
christopher tate
android framework engineer