I am attempting to build an Android app (without having to root the phone) which collects the IP addresses from all the apps' network connections to and from the phone.
I have been tasked with this project and the key point is that the phone must stay unrooted - this (to my knowledge) means I can't use tcpdump or libpcap, since both seem to need the phone to be rooted. One other point, I have found solutions where a VPN Service is used, but, if possible, I am not suppose to use this feature as well, since the app is suppose to work on it's own - without any 'outside' help.
I have been all over stack overflow and many many other sites, trying to find a method to monitor/collect IP addresses and all the solutions I've found required rooting the Android phone. This led me to believe that it wasn't possible, until I found the following app on Google Play.
https://play.google.com/store/apps/details?id=com.borgshell.connectiontrackerfree&hl=en
This app does much more than I need, but it somehow shows the IP addresses of network connections each app is making.
To summarize:
Does anyone know a way to collect IP addresses from internal app's network connections
without rooting the phone
without using a VPN service
Thank you
For all those who are curious about this same issue, I was able to finally figure out how to accomplish this task, without rooting the phone or using a VPN service.
The key to solving this issue, is to look in the following directory on the phone:
Also, here is some code from an open source project that does basically what I was looking for.