1

Here is our app usage scenario: There are two sections in our app, the first one is that we need load google map, and use google map apis, and the second one is that we need to connect to a personal wifi which can't connect to the public network. So the contradiction is that we can't use these two sections at the same time, if we connect to the personal wifi, we couldn't use google map, and when we disconnect to the wifi, we couldn't use the second section.

Does anybody have wonderful idea to solve this problem which has confused us a couple of days.

Thanks for any suggestion

SomnusLee
  • 401
  • 1
  • 6
  • 17

1 Answers1

0

Each wifi comes with its SSID, you can get the wifi SSID with CaptiveNetwork

Example on how to use it in this question

Basically if its your private wifi SSID then enable the 2nd, else enable google map stuff, i hope its what u want

Community
  • 1
  • 1
Tj3n
  • 9,837
  • 2
  • 24
  • 35
  • Thanks. In my opinion, this could only help me to decide which section to be enabled. But what I really want is a way to automatically route my http request(in 4g situation) and my udp request (in wifi situation). – SomnusLee Dec 10 '15 at 09:34
  • i don't really understand, if u don't want client using something in your app, simply hide it, why need routing the request to different host – Tj3n Dec 10 '15 at 09:43
  • think about this situation:step1.open app use google map for a while. step2. open settings, enable wifi and connect to the right wifi. step3. switch to app and use the 2nd section. It's so inconvenient. We want to use two sections without switching to settings app – SomnusLee Dec 10 '15 at 11:06
  • Then exactly what u want to achieve...? The only way to change Wifi setting is through setting app, there's no other way, if u want to check if the user on mobile network or wifi then its a different question than what u asking above – Tj3n Dec 10 '15 at 11:31