title: Android: programmatically determine list of apps that have a TCP connection open
body: <p>I would like know which applications on my android connect to what IP addresses. In essence I would like to know what these apps do in the background without my approval.</p>
  
  <p>I tried a netstat OS call in my monitoring app, which already gives me the open connections and the connected IP addresses, but there is no process name, pid or uid that would allow me to map a connection to a particular app. 'netstat -p' seems not to provide the process info.</p>