Android Question On devices that run Android 10 or higher, apps cannot access /proc/net

ebalvis

Member
Licensed User
Longtime User
I need to know the connection data wifi.
IP, mask, gateway, DNS...
With versions <10, I read the file
arpFile.Initialize(File.OpenInput("/proc/net/","arp"))
Starting with version 10, access to the directory is not allowed.

Restriction on access to /proc/net filesystem
On devices that run Android 10 or higher, apps cannot access /proc/net, which includes information about a device's network state. Apps that need access to this information, such as VPNs, should use the NetworkStatsManager or ConnectivityManager class.

How can i use the NetworkStatsManager or ConnectivityManager classes ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0

ebalvis

Member
Licensed User
Longtime User

Sorry, but I do not understand. How I can get the data that interests me from the network using the library UsageStatsManager?.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top