To be fair, it's already better than many of our competitors who would just drop the connection silently without notifying user. But still, we have build-in reconnect logic and why it's not working?
After a few days investigation and experiment, we think we found a reason.
What makes my VPN connection unstable?
Apart from unstable mobile network, one of the biggest causes of frequently disconnect / reconnect is Android Doze feature introduced in Marshmallow (Android 6.0), which is designed to save battery when you are not actively using the phone. This is accomplished by blocking notifications and networks, and preventing wake up app unless user want to. For more details, there is a good blog in lifehacker.
It's a good idea for most of the case, but VPN is a very special type of app. It's not always a good idea to save some battery at the cost of anonymity and security. Here is how you can turn off battery optimisation if you want.
How can I whitelist Just Proxy VPN?
Step 1: open the left drawer menu. You would see a newly added Battery Optimisation option. Tap it.
Step 2: a new dialog will popup, to confirm if you really want to switch off Battery Optimization
Step 3: another dialog from Android will be prompted to confirm on behalf of system
Step 4: done! If you want to re-enable battery optimisation, then just tap the same option from left drawer, another guide will popup for you to configure.
If it's not getting better, then most likely you are using a firmware that is having a different implementation than native Android, like MIUI. Here are the steps to manually configure:
Native Android 6.0 (Marshmallow)
Step 1: find Battery configuration in settings
Step 2: inside Battery main page. Expand top right menu and tap Battery Optimisation
Step 3: make sure you filter by App apps so that you can find Just Proxy VPN app from the list
Step 4: select Don't optimise option
Step 5: make sure Just Proxy app is now Not Optimised
MIUI 6.0Step 1: find Battery configuration in settings
Step 2: tap Manage apps battery usage
Step 4: Choose apps
Step 4: find Just Proxy VPN and make sure it's changed to No restrictions