I need to monitor all network activity on the device as part of my application rather than for debugging purposes. This post talks about using TCP dump, but some answers suggest this requires root. None of the answers really explain how you would do it within an app.
I know it is somehow possible to access all network traffic from within an app, because apps like Network Connections can display all IP addresses that are being accessed, and also which apps are accessing them.
Does anyone know which APIs, permissions, etc. I would need to use in order to get this kind of data in my app?