0

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?

Codebeat
  • 6,501
  • 6
  • 57
  • 99
  • These links might be helpful :) [Getting the available wifi lists](https://stackoverflow.com/questions/18741034/how-to-get-available-wifi-networks-and-display-them-in-a-list-in-android) [using preg match to filter SSID starting from umix_*](https://stackoverflow.com/questions/4722007/php-preg-match-to-find-whole-words) [Connecting/Disconnecting to the wifi](https://stackoverflow.com/questions/8818290/how-do-i-connect-to-a-specific-wi-fi-network-in-android-programmatically) – Dipak Poudel Jan 05 '18 at 03:11
  • @DipakPoudel: Thanks for the link, take a look at it. – Codebeat Jan 29 '18 at 00:22

0 Answers0