In my Android app I was reading ip addresses of other applications from /proc/net/tcp, but since android Q it is restricted to read from this file.
val br = RandomAccessFile("/proc/net/tcp", "r")
So I found out this question Acccess to /proc/net/tcp in Android Q where ConnectivityManager.getConnectionOwnerUid() suggested to access the ip addresses, but I can't understand how to use this API, there is no proper documentation for it. How I can use it?
And where should I get local and remote InetSocketAddresses?
public int getConnectionOwnerUid (int protocol, InetSocketAddress local, InetSocketAddress remote)
2.1m questions
2.1m answers
60 comments
57.0k users