Questions tagged [android-vpn-service]

101 questions
24
votes
3 answers

Android: Sample Code to connect to VPN in Android 4.0 using VPNService API

I am new to android and I am trying to establish and connect to our own vpn (Not the default vpn providers i.e, PPTP, L2TP etc which is present in the Android Setting -> Wireless and Networks) programatically. My scenario is, I have button and when…
Sudarshan
  • 1,291
  • 3
  • 26
  • 35
12
votes
0 answers

App crashes when trying to establish VPN connection?

According to the doc VpnService.prepare(context) is used to establish a VPN connection in android, and it's doing the trick in almost all device models except specific ones ( Oppo X9076 Android 5.0 ). As per the logs from within the crashlytics call…
Stella
  • 1,817
  • 6
  • 30
  • 55
9
votes
1 answer

Android VpnService protect socket that's stored in native code?

I'm writing a VPN application and the socket used for the VPN Connection is handled in my native C code, not in java. How do I use VpnService.protect() on that socket? I noticed that it has a VpnService.protect(int) overload, could I return the int…
Nathan F.
  • 3,250
  • 3
  • 35
  • 69
8
votes
1 answer

VPNservice.builder.addAddress - what does it do?

According to the official documentation: Add a network address to the VPN interface. Both IPv4 and IPv6 addresses are supported. At least one address must be set before calling establish(). Adding an address implicitly allows traffic from that…
itarill
  • 323
  • 1
  • 14
8
votes
0 answers

How to capture packets from applications protected from sniffing

I'm working on sniffing packets from Facebook android application. I want to use the sniffed data in my study of users behavior on social networks. What I learned in the last two months is that I have to create a vpn service and use it to sniff…
Abozanona
  • 2,261
  • 1
  • 24
  • 60
6
votes
2 answers

How do some apps block others from reaching WiFi/mobile-networks?

Background I've noticed various firewall apps on the Play Store being able to let the user choose which apps are allowed to use Wi-Fi and/or mobile-network for Internet connection. These app use VPN to have the control they need. An example for this…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
6
votes
0 answers

Creating a vpn profile and connencting (PPTP) with username and password in android programmatically

I want to build an app that can connect with a single click of button which will create a vpn profile and connect to the vpn profile by parsig the username and password of the vpn server. The code that is developed and modified is good to create and…
6
votes
1 answer

Android VpnService.Builder.establish() sporadically null

When I try to create the tunnel interface for my VpnService, I'm getting the following error: Attempt to invoke virtual method 'java.lang.String android.os.ParcelFileDescriptor.toString()' on a null object reference The only resolve I currently…
Nathan F.
  • 3,250
  • 3
  • 35
  • 69
6
votes
1 answer

Programmatically setting up a vpn on Android

I have found the following code to establish a new vpn programmatically but I do not know how to use it to create my app VpnService service = context.getSystemService(VPN_SERVICE); VpnProfile profile =…
user3073428
  • 63
  • 1
  • 1
  • 5
5
votes
1 answer

Is this possible to set Custom IP for DNS server in the Wifi Settings from my Android App?

I'm trying to set DNS to the Wifi and 4G data, So that i can use my Custom DNS server by which all my data will through my own server. By researching in internet i saw it's dificult to set for the application. But i saw some app are still in the…
5
votes
1 answer

"Allow USB debugging?" keeps popping up

I'm going nuts here. I am trying to debug my app on a Samsung Galaxy Tab S5e. My application runs a VPNService and I am reasonably sure this is the root cause of the following issue: When debugging via USB, everything works fine. However, when I…
pookie
  • 3,796
  • 6
  • 49
  • 105
5
votes
1 answer

Android: VPN connection using VPNService

I am trying to establish and connect to our own vpn (Not the default vpn providers i.e, PPTP, L2TP etc which is present in the Android Setting -> Wireless and Networks) programmatically. I would like to know if this is already possible as of…
Beatrice Lin
  • 1,456
  • 14
  • 17
4
votes
0 answers

What api can I use to connect to IPSec or L2TP Programatically Android

I need to connect to an api programatically in my app,but can't seem to find a way. I see VpnService, but this seems to only give you access to the TUN. How do I go about connecting to my already build IPSec and L2TP servers that have a username and…
Bk Razor
  • 1,492
  • 1
  • 14
  • 24
4
votes
0 answers

Why I can't see the hotspot traffic?

I want to know how it can be possible to manage the traffic of the clients connected to my android hotspot. The two mainly features I want to achieve are: Deny/allow the internet access to clients. Measure the amount of data consumed by…
crgarridos
  • 8,758
  • 3
  • 49
  • 61
3
votes
0 answers

How to tunnel whole device through a vpn from react native app?

I have been researching a way to create a VPN connection to tunnel whole device using react native but unfortunately there isn't any way to do that. There are Native Services to achieve that like VPNService in android and NetworkExtension in iOS but…
Awais Saifi
  • 67
  • 1
  • 8
1
2 3 4 5 6 7