Android OpenVPN Connect - get profiles

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
and
OpenVpn Newbie
Posts: 8
Joined: Tue Oct 10, 2017 9:23 am

Android OpenVPN Connect - get profiles

Post by and » Tue Oct 10, 2017 9:26 am

I'm developing an Android app and I need to interact with OpenVPN Connect. Using intents, I'm able to launch OpenVPN Connect and connect to a desired profile:

Code: Select all

Intent openVPN = new Intent("android.intent.action.VIEW");
openVPN.setPackage("net.openvpn.openvpn");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.openvpn.OpenVPNClient");
openVPN.putExtra("net.openvpn.openvpn.AUTOSTART_PROFILE_NAME", "VPN_PROFILE_NAME");
startActivityForResult(openVPN, 0);
Unfortunately, this solution implies I must know the profile name to connect to; so what I'm looking for is a way to get from OpenVPN Connect the list of imported profiles.

How can I do that?

Thanks.

Andrea

Karumansyah
OpenVpn Newbie
Posts: 1
Joined: Sat Oct 14, 2017 4:00 pm

Re: Android OpenVPN Connect - get profiles

Post by Karumansyah » Sat Oct 14, 2017 4:03 pm

Intent openVPN = new Intent("android.intent.action.VIEW");
openVPN.setPackage("net.openvpn.openvpn");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.openvpn.OpenVPNClient");
openVPN.putExtra("net.openvpn.openvpn.AUTOSTART_PROFILE_NAME", "VPN_PROFILE_NAME");
startActivityForResult(openVPN, 0);

and
OpenVpn Newbie
Posts: 8
Joined: Tue Oct 10, 2017 9:23 am

Re: Android OpenVPN Connect - get profiles

Post by and » Mon Oct 16, 2017 8:09 am

Hello Karumansyah,
your code is the same I wrote.
What I want to do is to programmatically get from OpenVPN Connect app the list of the imported profiles, in order to select one of these profiles and connect to it, thanks to the code I wrote (and you wrote again).
So you don't help me.

Andrea

and
OpenVpn Newbie
Posts: 8
Joined: Tue Oct 10, 2017 9:23 am

Re: Android OpenVPN Connect - get profiles

Post by and » Mon Oct 23, 2017 6:55 am

Can someone tell me if it is possible to do what I need about profiles?
Thanks.

Andrea

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Android OpenVPN Connect - get profiles

Post by TinCanTech » Mon Oct 23, 2017 11:10 am


and
OpenVpn Newbie
Posts: 8
Joined: Tue Oct 10, 2017 9:23 am

Re: Android OpenVPN Connect - get profiles

Post by and » Mon Oct 23, 2017 12:40 pm

Hello TinCanTech,
I suppose you are saying me to use shorcuts. Is it correct?

Andrea

and
OpenVpn Newbie
Posts: 8
Joined: Tue Oct 10, 2017 9:23 am

Re: Android OpenVPN Connect - get profiles

Post by and » Thu Oct 26, 2017 12:36 pm

So TinCanTech, did you mean the use of shortcuts?

Andrea

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Android OpenVPN Connect - get profiles

Post by TinCanTech » Thu Oct 26, 2017 12:51 pm

and wrote:
Tue Oct 10, 2017 9:26 am
I'm developing an Android app
Then you need help from a developer .. Read the FAQ

and
OpenVpn Newbie
Posts: 8
Joined: Tue Oct 10, 2017 9:23 am

Re: Android OpenVPN Connect - get profiles

Post by and » Thu Oct 26, 2017 1:05 pm

Dear TinCanTech,
I read the FAQ and I think the only relevant section (for my case) is:
Can I control the VPN from outside the app?
A: Yes, using shortcuts. Go to Menu / Add Shortcut to add a shortcut to your home page. Shortcuts can be created for:
connecting a specific profile,
disconnecting, and
launching the app
In the previous replies, I asked you if you meant that information: I don't understand why you wrote that sarcastic sentence. This is a support forum, then if you don't want to support me, please don't reply. Your sarcasm is useless.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Android OpenVPN Connect - get profiles

Post by TinCanTech » Thu Oct 26, 2017 1:29 pm

My reply is not sarcastic at all .. and the answer you are looking for is in the FAQ.

and
OpenVpn Newbie
Posts: 8
Joined: Tue Oct 10, 2017 9:23 am

Re: Android OpenVPN Connect - get profiles

Post by and » Thu Oct 26, 2017 1:53 pm

My apologies for thinking you were sarcastic.
However, I must admit I don't understand why you wrote:
Then you need help from a developer ..
I read the FAQ and I found that only passage about controlling the VPN from outside the OpenVPN Connect app.
But I can't use shortcuts...

You wrote the answer is in the FAQ. If I refer to shorcuts, the answer is: NO.

Do you confirm my theory?

and
OpenVpn Newbie
Posts: 8
Joined: Tue Oct 10, 2017 9:23 am

Re: Android OpenVPN Connect - get profiles

Post by and » Fri Nov 03, 2017 3:28 pm

Please, can someone help me?

Post Reply