How do I use VPN only in one android application?

Viewed 22

I need to use the built-in VPN in my Android application. When I open my application, I need to start VPN from app, and disconnect when I quit the app.

The condition is that VPN only works on my application and has no effect on any other app. I need some source code or solution.

Language: JAVA {Android}

Example Apps: OPERA BROWSER

link: https://play.google.com/store/apps/details?id=com.opera.browser&hl=en_IN&gl=US

1 Answers

When I open my application, I need to start VPN from app, and disconnect when I quit the app.

That is not an option.

The condition is that VPN only works on my application and has no effect on any other app

The "built-in VPN" affects the entire device.

Example Apps: OPERA BROWSER

They have their own VPN built into their app. They are not using a device-supplied VPN.

Related