Search code examples
javaandroidsettingsandroid-wifi

Android app: How to control system settings?


Disclaimer: I am a seasoned developer, but quite a newbie in the Android arena, sorry if asking the obvious.

I need to write a "simple" App to collect data from other devices (Linux embedded) over which I have full control.

Communication will be over WiFi.

Cycle should be:

  1. Make sure Android device Portable WiFi HotSpot is ON with specific SSID/Pass.
  2. Start listening on socket.
  3. Wait for devices to connect.
  4. Wait for devices to deliver data.
  5. Store data to MySql database.
  6. Shut down Portable HotSpot (or, better, restore HotSpot to previous status).

I have found no documentation on steps 1 and 6.

Is that possible at all?

Note: This should work on a generic android phone without requiring rooting it.

Background: we produce the above-mentioned "devices" which collect data and send it to a server via WiFi; when Internet connection is missing we want to provide User with a fallback solution: cache data on his own phone and, later on, when he is on-line, to deliver it to server. This should be as unobtrusive as possible on user phone, of course.

Any advice is welcome.


Solution

  • This are a lot of questions. Usually we limit them to one. Anyways, here are some links that might be helpful:

    1. 1. Enabling Wifi-Hotspot (since Android Oreo)
    2. Android Server Sockets
    3. Using SQLite

    I hope it helps you to get started. If you have any specific issues, post them seperately here at SO