Detect behind VPN in android -
how detect programatically if traffic going through vpn without using intent connect vpnservice. there system call?
the android os aware of when vpn connection active (as shows icon in status bar duration of vpn connection) there no public api method (which appear on vpnservice) check active connection.
two solutions occur. if dealing specific situation know network topology, run 'ping' see if particular ip address available - use system.exec. ping command present on android devices stock roms, i've used part of solution to provide more granular view of state of data connection (ip address not allocated, ip address allocated can't access internet, can access internet)
a better solution run traceroute instead , analyse output. i've not checked if traceroute present on android devices stock roms, i'll edit answer later more complete information.
Comments
Post a Comment