1

I'm developing an app that configures an IoT device that my company produces.

For that to happen I needo to connect to the Access Point from the IoT device and communicate via HTTP with it.

The part of connecting to the device is already done, but i'm having a problem with Android 9.0. Sometimes, not always, an Android 9.0 device is connected to the Iot device but the communication does not happen, it is like my Android device is not connected at all with the IoT device, even with, in wi-fi settings, shows that is connected.

I,ve made a lot of research before asking this question, and I found out that, when the Access Point does not have internet access, the Android device drops the connection automatically. I also found out that this "problem" could be solved by setting a STATIC IP ADDRESS for my connection with the IoT device, and it really works, but the problem is that my app can configure several IoT devices at once, and it is impracticable for the user to enter in every IoT's connection an set a STATIC IP ADDRESS for it. So I've made a lot of research of how to set a STATIC IP ADDRESS programmatically, and I found here and here some answers but none of them worked for me, they are using an Enum that does not exists, at least I can't find them anywhere.

Finally, what I need to know is if it is possible to do what I want to do with my app, and, if it is, if anyone can, at least, give me a light of where can I find the solution or where to start, because I'm totally lost in this subject.

I'm sorry for my bad english and for my knowledge in Android, I'm only starting at this world.

Thank you very much for the attention, and if I need to provide more information or code to help the answer, plese tell me.

  • 1
    Android will try to direct all network traffic to the network interface with the best internet connection. Since the IoT device does not have an internet connection, it is just a WiFi hotspot. You can force android to use the WiFi interface when connected to the IoT device's WiFi. – RScottCarson May 07 '20 at 22:14

0 Answers0