###Reference:
Android 4.0 has an API to build VPN services.
- VPNService (Android Docs)
- VPNService.Builder (Android Docs)
- Arne Schawbe's Implementation of OpenVPN for Android (github)
One such app with a VPN service is NetMotion Mobility® (Google Play)
Beginning with the "Lollipop" version, Android come with a new VPN type which provides information about VPN connection state, whether requests go over the VPN, etc.
###Test Results
(Connected to VPN)
- Android < =5.0(Android Lollipop)
- Connection is successful with WIFI(Wlan) and Cellular(rmnet) interface IP’s.
- Connection is successful with VPN(tun) interface IP address but does not get VPN connected/disconnected events.
- Android > 5.0(Android Lollipop 5.1 and 6.0)
- Connection is not Successful with WIFI(Wlan) and Cellular(rmnet) interface IP’s.
- Connection is successful with VPN(tun) interface IP’s address and also get VPN connected/disconnected events.
- ConnectivityManager#TYPE_VPN
- NetworkCapabilites#TRANSPORT_VPN
- NetworkCapabilities#NET_CAPABILITY_NOT_VPN
Indicates that this network is not a VPN. This capability is set by default and should be explicitly cleared for VPN networks. Constant Value: 15 (0x0000000f)
###Questions:
- When the VPN service is active on the device how do requests work from 3rd party apps like WhatsApp, Skype or the browser?
- When the VPN is connected what exactly happens to the device IP stack?
- How does VPN tunneling work in Android?
- What is the design for an app which binds to active IP and sends requests?
- Are the VPN APIs in lollipop (5.0) not stable?
- If bindProcessToNetwork is done over Celluar network and WiFi is connected in device, which network will the VPN use?