Java Code Examples for de.blinkt.openvpn.VpnProfile#prepareStartService()

The following examples show how to use de.blinkt.openvpn.VpnProfile#prepareStartService() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VPNLaunchHelper.java    From SimpleOpenVpn-Android with Apache License 2.0 5 votes vote down vote up
public static void startOpenVpn(VpnProfile startprofile, Context context) {
	Intent startVPN = startprofile.prepareStartService(context);
	if(startVPN!=null)
           if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
               context.startForegroundService(startVPN);
           } else {
               context.startService(startVPN);
           }

}
 
Example 2
Source File: VPNLaunchHelper.java    From bitmask_android with GNU General Public License v3.0 5 votes vote down vote up
public static void startOpenVpn(VpnProfile startprofile, Context context) {
    Intent startVPN = startprofile.prepareStartService(context);
    if (startVPN != null) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
            //noinspection NewApi
            context.startForegroundService(startVPN);
        else
            context.startService(startVPN);

    }
}
 
Example 3
Source File: VPNLaunchHelper.java    From Cake-VPN with GNU General Public License v2.0 4 votes vote down vote up
public static void startOpenVpn(VpnProfile startprofile, Context context) {
    Intent startVPN = startprofile.prepareStartService(context);
    if (startVPN != null) context.startService(startVPN);
}
 
Example 4
Source File: VPNLaunchHelper.java    From Cybernet-VPN with GNU General Public License v3.0 4 votes vote down vote up
public static void startOpenVpn(VpnProfile startprofile, Context context) {
    Intent startVPN = startprofile.prepareStartService(context);
    if (startVPN != null) context.startService(startVPN);
}
 
Example 5
Source File: VPNLaunchHelper.java    From EasyVPN-Free with GNU General Public License v3.0 4 votes vote down vote up
public static void startOpenVpn(VpnProfile startprofile, Context context) {
	Intent startVPN = startprofile.prepareStartService(context);
	if(startVPN!=null)
		context.startService(startVPN);

}