Connect to specific network SSID (hotspot) when app active

520 views Asked by At

Before I start this journey in Android I want to know if it is possible to connect to a specific network SSID when an app is active and restore the previous network settings when exit the app or when the device go sleep.


The reason I want to this:

  • An app for a specific device that can be reachable via adhoc connection;
  • No need to hook into an existing network (adhoc device needs no config), so user friendly;
  • The app can use the all of the features of WIFI;
  • Device is isolated from the internet and provides own network

The idea:

  • The app discovers the available WIFI-networks when no device is configurated yet;
  • The device can be found via an SSID prefix, for example 'umix_' and user can select the unique correct name after the prefix, for example: 123456 (= umix_123456);
  • Once successfully connected, this name will be used to connect;
  • User can use the device via WIFI;
  • When exit the app or device go to sleep it reconnects to previous network;
  • When the app is active on wake up, it reconnects to the device it's network.

Maybe the described behaviour looks like a bluetooth connection, however, it is not because it is WIFI, better bandwidth for example and server facilities. However, the easy of use for it's user is similar to bluetooth, I want to achieve this.

Because I cannot find any info on this on the net, I ask it here. Is what I want possible anyway? Any directions, links, code examples?

0

There are 0 answers