v2rayNG for Android: VPN Permission, Battery Optimization & Per-App Proxy

Set up v2rayNG on Android: approve the VPN connection, exempt it from battery optimization, and configure per-app proxy rules. Find fixes for background disconnects.

At a glance

For Android users who have imported a node but can’t connect, lose the connection after locking the screen, or want proxy routing for only selected apps. First approve the system VPN request, then address background restrictions, and finally configure the per-app list. These steps control whether v2rayNG can capture traffic, keep running, and handle traffic from the apps you choose. A “connected” status alone doesn’t confirm all three.

VPN permission: Allow a local VPN connection

v2rayNG uses Android’s VpnService API to receive app traffic and pass it to the Xray core for processing according to your configuration. The first time you tap Connect, Android usually displays a network connection request or VPN confirmation dialog. This permission lets the app create a virtual network interface; it isn’t for signing in to a subscription or importing nodes, and it doesn’t require root access.

Granting permission only confirms that a local traffic entry point can be created. You still need to check whether the node is reachable, its credentials are correct, and its domain name resolves. A VPN icon in the status bar doesn’t prove the connection to the remote proxy is working.

API 14
Android 4.0 introduced the VpnService API
API 21
Android 5.0 added the per-app VPN API
1
VPN services active at the same time for one user or profile

These figures describe Android API limits, not the minimum OS version required by the installed app. If another app is already using the VPN interface, starting v2rayNG may replace its connection or be blocked by that service’s always-on policy. Work and personal profiles may also be governed by separate policies, so check both profiles.

  1. Check your node

    Select an imported node on the v2rayNG home screen. Make sure a node appears in the list before handling system permission; granting permission won’t add subscription details.

  2. Resolve conflicts

    Open Settings → Network & internet → VPN to check which service is active. On other Android versions, search Settings for “VPN” and stop any conflicting connection first.

  3. Allow the connection

    Return to v2rayNG and tap Connect. Check the app name in the system dialog, then tap OK. If you tapped Cancel, try connecting again to request permission.

  4. Test access

    Keep v2rayNG in the foreground and open a site that should use the proxy. If it still fails, check the connection or DNS errors in v2rayNG’s Logs rather than reinstalling the app as a substitute for troubleshooting.

Battery optimization: Allow background activity

“Works with the screen on, disconnects after being locked” points to a background-running issue. “Can’t open websites as soon as it connects” calls for checking the node, routing, and DNS first. Separate these symptoms to avoid changing a series of battery settings that don’t address the real problem. Battery exemptions reduce system restrictions; they can’t guarantee an uninterrupted connection on every network.

Here are common settings paths. Names can vary by Android version, launcher, and manufacturer updates. If you can’t find a setting, long-press the v2rayNG icon, open App info, and look for Battery, Power usage, or Background. Adjust v2rayNG only; there’s no need to remove battery restrictions for every app.

Android version or manufacturerCommon settings pathWhat to check
Near-stock Android Settings → Apps → v2rayNG → App battery usage Allow background usage. If Unrestricted is available, select it for v2rayNG.
Xiaomi MIUI / HyperOS App info → Battery saver; Settings → Apps → Permissions → Autostart Set Battery saver to No restrictions. Allow autostart if needed; some versions call this Background autostart.
Huawei EMUI / HarmonyOS Android compatibility environment Settings → Apps & services → App launch → v2rayNG Turn off automatic management, then check Allow auto-launch, Allow secondary launch, and Allow background activity.
OPPO ColorOS / corresponding OnePlus systems App info → Power usage or Battery usage Allow background activity. If there’s a separate autostart setting, check it too.
vivo OriginOS Settings → Battery → Background power consumption management → v2rayNG Allow high background power consumption. If the app needs to restart automatically, check its autostart permission too.
Samsung One UI Settings → Battery → Background usage limits; Apps → v2rayNG → Battery Remove v2rayNG from the Sleeping and Deep sleeping lists. If available, add it to Never sleeping apps and check its battery restrictions.

Locking v2rayNG in Recent apps can reduce accidental cleanup, but it isn’t a battery exemption. Force stop is also different from simply switching to another app: after a force stop, you’ll usually need to open v2rayNG manually. Battery Saver or Ultra Power Saving mode may impose additional manufacturer-specific limits.

Per-app proxy: Choose what your list means

In v2rayNG, open the side menu and go to Settings → Per-app proxy. Enable the feature, then choose how the app list works. The Bypass mode switch commonly reverses the selection: when off, selected apps use the VPN; when on, selected apps bypass it. Labels can vary between builds, so read the on-screen description instead of relying on the checkbox position alone.

“Use the VPN” here means the app’s traffic is passed to v2rayNG; it doesn’t mean every request goes to a remote node. Routing rules can send captured traffic through the proxy, directly, or block it. Apps that bypass the VPN aren’t handled by these rules, so v2rayNG can’t route their domains for them.

Proxy only selected apps

Enable per-app proxy
On
Bypass mode
Off
App list
Select the apps that should use the VPN
Apps not selected
Don’t use this VPN

Useful when only a few apps, such as a browser, should be handled by the proxy.

Bypass selected apps

Enable per-app proxy
On
Bypass mode
On
App list
Select the apps to exclude
Apps not selected
Usually use the VPN, subject to system policies

Useful when most apps should use the VPN and a few should use the local network instead.

Don’t switch Bypass mode without changing the app list. For example, if only your browser is selected, turning Bypass mode off sends it through the VPN; turning the mode on excludes it. The list hasn’t changed, but its meaning has completely reversed. This is a common reason the browser stops working as expected after configuration.

How per-app selection differs from routing rules

Per-app proxy answers “Which apps should v2rayNG handle?” Routing rules answer “Which domains or IPs should use which outbound route?” For example, an app list can’t distinguish between a browser request to a local service and one to an external site; check routing rules for that. Conversely, a domain rule can’t capture traffic from an app that bypasses the VPN.

Two setup patterns: include a few or exclude a few

Include only a few apps
  • Enable per-app proxy and turn off Bypass mode.
  • Select only the browsers or tools that should use the proxy.
  • Routing rules determine how captured traffic is routed.
  • Add new apps to the list manually.
Exclude only a few apps
  • Enable per-app proxy and turn on Bypass mode.
  • Select only the apps that should bypass the VPN.
  • Other apps usually use the VPN, then follow the routing rules.
  • When you add an app, check whether it belongs on the exclusion list.

Choose how the app list works before setting up routing. Change one layer at a time to make test results easier to interpret.

Screen lock and network changes: Retest in order

After changing battery settings, don’t rely on a single latency check from the home screen. Foreground use, use after locking the screen, and use after changing networks are three separate checks. The timings below are for your own troubleshooting only—not a performance guarantee or test result from this site.

  1. Foreground baseline: Stay connected to Wi-Fi, start v2rayNG, send a new request from the target app, and note the current node and time.
  2. Background test: Return to the home screen, lock the device, and wait about 10 minutes. Unlock it and send another request, then check the system VPN status.
  3. Network switch test: Switch from Wi-Fi to mobile data and try again. Existing connections need to be re-established, so a brief failure doesn’t necessarily point to battery restrictions.
  4. Compare app lists: Test one app that uses the VPN and one that bypasses it. If only the first fails, check the node and routing. If both fail, check the current network first.
  5. Check the logs: Keep the connection, DNS, or network-switch details around the time the issue occurred. Before asking for help, remove subscription URLs, credentials, and sensitive server information.

If the VPN service is still running after the screen locks but the logs show remote connection timeouts, check the network and node instead of changing every battery setting again. If the VPN service itself stops, focus on background battery restrictions, cleanup policies, and conflicts with other VPN apps. Switching from Wi-Fi to mobile data can also change DNS and network routes, so reassess the connection on the new network.

Common questions: VPN permission, app lists, and background disconnects

I tapped Connect but didn’t see a permission prompt. Did the VPN start?

If you previously approved the request and the permission is still valid, Android may not ask again. Go to Settings → Network & internet → VPN to check for an active connection, then check v2rayNG’s status. If you can’t confirm the system dialog, temporarily disable screen overlays and try again; also check device management policies.

Why doesn’t my selected browser use the proxy?

Go to Settings → Per-app proxy and check Bypass mode. When it’s on, selecting an app excludes it rather than including it. After correcting the setting, disconnect and reconnect, then close and reopen the browser. If the browser is using the VPN but still connects directly, check whether its destination domain is routed through a direct outbound.

The connection still drops after I exempted v2rayNG from battery optimization. What next?

First check whether the system VPN has disappeared or is still connected while requests fail. For the first case, check autostart, background activity, task cleanup, and other VPN apps. For the second, inspect the logs for network changes and timeouts. Allowing autostart doesn’t replace allowing background activity; these permissions address different issues.

Apps that bypass the VPN can’t connect at all. What should I change?

Open the system VPN settings and check whether Block connections without VPN is enabled. This policy may block apps excluded from the VPN. On a personal device, adjust it to suit your needs; on a managed device, contact your administrator. Also check that mobile data access hasn’t been disabled separately for the app.

Does enabling per-app proxy affect subscription updates?

Subscription updates are requests made by the client itself. Their route depends on how the client is implemented and on its update settings, so you can’t infer it from another app’s list. If an update fails, check the subscription URL and current network first, then review the update options. Don’t reverse the entire app list just to update a subscription.

Once troubleshooting is complete, keep a configuration you can reproduce and verify: VPN permission is granted, background activity is allowed, and the per-app list has a clear purpose. For more on domain routing and DNS, see the site’s Advanced Guide. To import a node for the first time, start with the Setup Guide.

Download v2rayN