java - How get full info of runtime.getruntime.exec("netstat") -


i can't full info netstat, not rooted device.

if use

process process = runtime.getruntime().exec("netstat -n"); 

with "-n" or other doesn't work. how read stream netstat

process.getoutputstream().close(); bufferedreader reader = new bufferedreader( new inputstreamreader(process.getinputstream())); string line; while ((line = reader.readline()) != null) { // parse line required info } reader.close(); 

how can pid or process name using netstat (or other monitor network activity) without root

i test in android 6.0 , only:

proto recv-q send-q local address foreign address state click see

you must input stream process object , read process output line line until null line received.

proto recv-q send-q local address foreign address state

it's first line of netstat output.

for example: https://stackoverflow.com/a/13506836/4449456


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -