Click here to Skip to main content
15,300,241 members
Home / Discussions / Android
   

Android

 
QuestionDetect VPN From Android App Pin
Kevin Marois26-Nov-18 4:04
professionalKevin Marois26-Nov-18 4:04 
I'm working on an Android app that we only want to allow to run if the user has VPN'd into the network.

The question is, how do I determine if the user has VPN'd in?

I have tried the following:
var address = Dns.GetHostAddresses("www.mycompany.com").FirstOrDefault();
var hostName = Dns.GetHostName();
var domainName = System.Environment.UserDomainName;

UserDialogs.Instance.Alert(domainName, "Domain Name", "OK");
UserDialogs.Instance.Alert(hostName, "Host Name", "OK");
UserDialogs.Instance.Alert(address.ToString(), "Address", "OK");

The results are always the same, even if I'm NOT VPN'd in.

Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: Detect VPN From Android App Pin
Richard MacCutchan26-Nov-18 5:04
mveRichard MacCutchan26-Nov-18 5:04 
GeneralRe: Detect VPN From Android App Pin
Kevin Marois26-Nov-18 5:25
professionalKevin Marois26-Nov-18 5:25 
GeneralRe: Detect VPN From Android App Pin
Richard MacCutchan26-Nov-18 6:53
mveRichard MacCutchan26-Nov-18 6:53 
GeneralRe: Detect VPN From Android App Pin
Kevin Marois26-Nov-18 7:26
professionalKevin Marois26-Nov-18 7:26 
QuestionRe: Detect VPN From Android App Pin
David Crow26-Nov-18 7:50
MemberDavid Crow26-Nov-18 7:50 
AnswerRe: Detect VPN From Android App Pin
Kevin Marois26-Nov-18 9:12
professionalKevin Marois26-Nov-18 9:12 
QuestionRe: Detect VPN From Android App Pin
David Crow26-Nov-18 9:17
MemberDavid Crow26-Nov-18 9:17 
AnswerRe: Detect VPN From Android App Pin
Kevin Marois26-Nov-18 9:21
professionalKevin Marois26-Nov-18 9:21 
SuggestionRe: Detect VPN From Android App Pin
David Crow26-Nov-18 9:26
MemberDavid Crow26-Nov-18 9:26 
GeneralRe: Detect VPN From Android App Pin
Kevin Marois26-Nov-18 11:00
professionalKevin Marois26-Nov-18 11:00 
GeneralRe: Detect VPN From Android App Pin
Mycroft Holmes26-Nov-18 13:47
professionalMycroft Holmes26-Nov-18 13:47 
GeneralRe: Detect VPN From Android App Pin
Richard MacCutchan26-Nov-18 21:14
mveRichard MacCutchan26-Nov-18 21:14 
QuestionRe: Detect VPN From Android App Pin
David Crow26-Nov-18 6:54
MemberDavid Crow26-Nov-18 6:54 
AnswerRe: Detect VPN From Android App Pin
Kevin Marois26-Nov-18 7:26
professionalKevin Marois26-Nov-18 7:26 
QuestionExpandableListView ChildView button click event fires on multiple ChildView buttons Pin
GuyThiebaut17-Nov-18 5:57
professionalGuyThiebaut17-Nov-18 5:57 
QuestionRoundCube Pin
C-P-User-311-Nov-18 23:08
MemberC-P-User-311-Nov-18 23:08 
AnswerRe: RoundCube Pin
Richard MacCutchan12-Nov-18 2:08
mveRichard MacCutchan12-Nov-18 2:08 
QuestioncPanel ? Pin
C-P-User-311-Nov-18 23:06
MemberC-P-User-311-Nov-18 23:06 
Questionget request volley return normal null Pin
Member 1308507021-Oct-18 23:51
MemberMember 1308507021-Oct-18 23:51 
QuestionRe: get request volley return normal null Pin
David Crow30-Oct-18 4:03
MemberDavid Crow30-Oct-18 4:03 
SuggestionRe: get request volley return normal null Pin
thatraja30-Oct-18 4:30
professionalthatraja30-Oct-18 4:30 
QuestionHow connect with IR camera, deep camera Pin
pablogvivo8-Oct-18 20:03
Memberpablogvivo8-Oct-18 20:03 
Questionandroid Pin
Member 1399693125-Sep-18 2:14
MemberMember 1399693125-Sep-18 2:14 
Questionandroid layout problem Pin
Member 1399693125-Sep-18 2:16
MemberMember 1399693125-Sep-18 2:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.