Questions tagged [android-vpn-service]
101 questions
0
votes
1 answer
Using a file descriptor from Android VpnService.Builder in native code
I am making a VPN application in Android and the following seems to work great:
public class MyVpnService extends VpnService {
private ParcelFileDescriptor lt;
public int onStartCommand(Intent intent,
int…

user1772004
- 165
- 1
- 6
0
votes
1 answer
When the VPN is connected, user will be able to enter the app and if they are not connected, they will not be able to enter. How do I do that?
I have seen in many apps that when VPN is connected you can get inside the app and if you are not connected you can't get in.
How can I do this with Java programming?

Masud Reza
- 3
- 1
0
votes
1 answer
Android VPNService setBlocking(true) Breaks VPN
I'm looking at trying to implement a VPNService on Android for packet filtering and reporting and I have initially been looking at this project:
https://github.com/hexene/LocalVPN
As well as this I have been looking at Google's ToyVpn as a basis to…

Rich Shepard
- 347
- 2
- 7
0
votes
1 answer
How to achieve VpnService's protect in an iOS VPN?
I'm porting an Android device's VPN App to iOS (using NEPacketTunnelProvider).
Android provides a mechanism to bypass VPN for some tcp/udp connections, using the following API:
class VpnService {
// ...
public boolean protect(int socket) {…

Top-Master
- 7,611
- 5
- 39
- 71
0
votes
1 answer
VpnService.Builder IPv6 error null object
builder.setSession("MyVPNService");
builder.addAddress(deviceIp, 24);
builder.addDnsServer(dnsIp)
.addDnsServer(dns2Ip)
…

jcooli
- 1
- 5
0
votes
1 answer
error: cannot find symbol if (!"ovpn3".equals(BuildConfig.FLAVOR))
When I create vpn app I am geting this type of error plz someone help me in this
C:\Users\asus\Desktop\WorkBook\UltimateVpn\app\src\main\java\de\blinkt\openvpn\core\OpenVPNService.java:472: error: cannot find symbol
if…

Jay Prakash
- 1
- 1
0
votes
0 answers
Disconnect the VPN that other apps have enabled in Android
Is there a way to disconnect any VPN connection on the Android device?
My app uses Wi-Fi Direct to establish a P2P connection with other devices. On some devices, Wi-Fi Direct does not work when the VPN is active, and I want to disconnect any VPN…

Hussein Yaqoobi
- 442
- 5
- 20
0
votes
1 answer
Accessing Web-Services from Android which are accessible through VPN on Web
I have a application i know how to consume web services i am up with a challenge and lack of knowledge on network side,
The Web Services are accessible through VPN on Web which is protected with
Credentials.
I am looking around connecting VPN…

Malik Saifullah
- 522
- 1
- 6
- 22
0
votes
1 answer
Java NIO FileChannel - Empty reads from Android TUN network interface
Context: I've recently started using java.nio for my project which leverages Android's VpnService. In my implementation, I've wrapped the FileDescriptor that is returned by the establish() method of the VpnService into a java.nio.FileChannel as…

Siddharth Kamaria
- 2,448
- 2
- 17
- 37
0
votes
0 answers
Packet Encoding in Java and Packet Decoding in C Failed
Hi I have 2 functions to encode a packet in Base64.
But the client can not connect with the server.
May be the encoding and decoding is in problem.
These two programs might not working combinedly.
This is for sending a TCP Packet after Base64…

Rajib Hossain Pavel
- 438
- 7
- 22
0
votes
1 answer
VPN Service setHttpProxy with Pac URI
According to Android docs, the VpnService.Builder.setHttpProxy method has been added in API level 29. Which is fine.
But the setHttpProxy method needs and object for ProxyInfo class, which is deprecated in API level 22.
Now I need to use the…

Mayur More
- 951
- 2
- 15
- 37
0
votes
1 answer
On Android app cold start, prevent network requests until VPN started
In our app we have many different modules that can make network requests on their own. App has option to use VPN for secure connection. VPN service is only handling network for our app.
My problem is: on app cold start, when VPN feature is enabled,…

Rafael
- 6,091
- 5
- 54
- 79
0
votes
1 answer
Unable to create Vpnservice
I am a beginner, I am having trouble using VpnService.
Bad prefixLength Caused by: android.net.VpnService$Builder.addAddress(VpnService.java:496)
The above is the error log.
Builder builder = new Builder();
builder.addAddress("211.147.226.4",…

liqichu
- 1
- 1
0
votes
2 answers
Is there an 'on forget' vpn listener?
I'm developing an app that implements a VPN service and I want to listen when the user clicked "Forget VPN" on my app's VPN service from android settings.
Is there a way to do it?

AyTee
- 489
- 1
- 8
- 19
0
votes
1 answer
Detect if vpn service is on or not problem
I'm facing problem with some devices like some android box or Huawei Phones
I need to protect my app if user use packet monitor app what I did is if user has a vpn active on their device don't request jsonparse
but some devices even if vpn…

saifapp
- 1
- 6