How to Force the device to connect to a certain connection type

Hi, im working with xamarin Forms developing an Android app (is cross platform, but the IOS app is not a priority). I i've been searching info about this in many forums but seems that nobody've exposed a real solution to this, if there's. In the app that i'm developing, the client needs to connect to a WiFi Network that has no Internet connection. I'm able to stablish the connection with the Android API libraries, but the "Smart WiFi Network" function from many devices prioritize the network with the best internet connection, leaving the device connected to the Mobile network instead of WiFi. If i disable this function, the app works without problem, but the problem is that this app is gonna be used by hundreds of people, and many of them have a very limited knowledge about phone configuration. So, my chances are to force the device to connect to the WiFi or to notify the user that the "Smart WiFi Network" is activated. The problem with the second option is what, that option is called diferent from device to device (in my device is called "WiFi Assistant" and on a Sansung Galaxy from a partner is called "Auto Network Switch" or something like that), so i'm not sure what is the real parameter that i need to find, and also i need to trust in the user capabilitie to configure they own device. So my best option would be to force the device to connect to the WiFI type network, but i can't to do that right now. So, in resume my question would be ¿Is there any way to force de device to connect to a certain Network type instead of another?. Thanks in advance for any help and i'm sorry if my english is not good, i´m not used to write in english, i hope that the message is clear.


  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭
    The connectivity plugin can, if I remember correctly, determine the connection type (wifi etc). So with this you should be able to tell the user to connect to wifi if a non wifi connection is detected.

    Out of interest, why does the app need to connect to wifi only?
  • FArrigorriagaFArrigorriaga Member ✭✭
    edited August 2018

    Thanks for your answer, i'm already doing that, but i want to minimize the user interaction, but if there's no other chance, i'll stay with this.
    The app needs to connect to WiFi because the client needs to get reports from a device that is not connected to internet (a lock system software that we develop that is running over windows 7). So in that device we created a hosted WiFi Network to send the reports to the users phone through a QR code. The QR code contains the network SSID, the password and the download Link of the file (the Locking system manage his own local storage "cloud"), the app just interpretate the data, so with only one QR code, the phone should connect automatically to the hosted network, and when is connected, the app download the report to the phone in pdf format and show it to the user. We tried many ways to make the communication between this 2 devices (WiFi direct, Bluethoot, NFC,etc), but this approach seems to be the easiest to understand to the user, is the one with less user configuration needs and the compatibility with windows 7 is assured (Windows 7 doesn't have implementations for WiFi direct). This devices are located on a mining zone with no internet connection possible and the system has to be windows 7 (client's requirments).

  • WelingtonBRWelingtonBR Member ✭✭

    Hi @FArrigorriaga,

    Did you get a solution to avoid auto switch network? I'm have the same problem.

Sign In or Register to comment.