Search code examples
androidrestwifiwifi-direct

Access REST end point on an embedded device using WiFi direct from android


I have an embedded device that exposes its functionalities via a RESTful Web service. I want to consume those Web services via my android device by connecting my mobile to the embedded device via Wifi? Is it possible to do so?

The possible use cases are transferring the control panel UI of the embedded device to the android and controlling it remotely. The UI is exposed as a REST endpoint.


Solution

  • If the chip you are using supports Wi-Fi Direct, you should search for its code yourself since I don't know about it really, but you can find documentation and examples of wifi direct here, and if it doesn't support it, there are two scenarios, one is that you want to make your android device a server and your chip a client, which leads you to use Nanohttpd in your android code to make a server, and the other one is to bring up a server on your chip and make your android device a client, which leads to using a library like loopj which saves lots of pain. so I guess that was all.