Is there a script for Android to change networks?

M
Mitchell
schusterco

I'm trying to figure out the best way to prioritize wifi connections on Android 11. 

Our tablets are connected to a hotspot in a vehicle and would like them to connect to our wifi network whenever they come back to the yard. They do not automatically connect to the wifi because the signal from the hotspot is stronger than the access points. 

Is there a script to run when it enters a geofence or is there a better way going about this problem?

3 years ago
Android Scripting
ANSWERS
RS
Rafael Schäfer Diamond Contributor
3 years ago

If you use Geofence, you can use an alert rule for that (you can disable that an alert is raised, so it's some kind of silent alert rule) by executing a script when entering and/or leaving.

But i currently don't know any possibility of connect to a specific wifi ssid via script (we would also like to have something like that).

RC
Raymond Chan Diamond Contributor
3 years ago

Are the SSID & credential associated with the hotspot in the vehicle managed via MobiControl?  Or manually input by the tablet end-user?

M
Mitchell
3 years ago

The SSID and credential associated with the hotspot is managed via Mobicontrol

RC
Raymond Chan Diamond Contributor
3 years ago

Hi Mitchell,

I don't know how big is your car yard and whether it is open/outdoor or covered/indoor or underground.  If the GPS signal is reasonably strong in the car yard such that a geofence alert rule can be used reliably, then you can consider configuring alert action to relocate the device to a new device sub-group with all in-vehicle hotspot Wifi profiles removed. Depending on your device model and firmware,  there likely a need to force a Wifi radio off for a short period of time followed by re-enabling of the Wifi radio so that the only remaining Wifi of your car yard is selected.     There can also be GPS sensitivity problem that the geofence rule gets fired when the vehicle is close to but not yet in the yard (thus no car-yard Wifi connectivity), hence causing pre-mature removal of Wifi hotspot profiles and eventual out-of-contact deadlock.

If the above does not work reliably due to GPS, you might need to consider trying some third-party Wifi prioritize/select app available on Google Play Store.   I haven't tried them out myself to see how well they can perform and adapt to the use case you need.   

The final solution is to build a custom  app to monitor availability of your car-yard Wifi (know SSID and BSSID/Mac-address).  The app can provide custom data for MobiControl data-collection rule and alert rule together to initiate  either removal of all hotspot Wifi profiles or  notify the app to directly select the car-yard Wifi SSID.

M
Mitchell
3 years ago

We tried a WIFI priority app and that worked well. Unfortunately, the app was removed from the play store. 

Our yard is in the open with good GPS signal and has outdoor coverage for WIFI. I'll have to try to find another app that will choose the priority.