views:

29

answers:

1

Programmability i want monitor IP ever connected to my Adnroid device.

My initial thought is i can write a background service which will run tcpdump command and forward its output to inputStream. By putting any regular expression i can retrieve list of connected IP to my device.

I think that would be bulky to continually run command like tcpdump.

any better solution ??

Edit - typo

+1  A: 

You'll have to choose how often to run tcpdump, and that'll be tricky - running it more frequently will have a performance impact, but running it less frequently may mean that you miss short-lived connections. Perhaps you could set up a logging "firewall" on your device using iptables ( http://www.linuxquestions.org/questions/linux-security-4/iptables-logging-385165/ ), and then parse the output of THAT whenever you actually need the output?

Curtis
TCPDump needs you to root your Android device, and I dont want to do that. Anything way around ??
Rajnikant