I've created a mobile application using android studio to control some leds, sensors, and locks. So I'd want to connect my mobile application to my raspberry pi to send and receive data, how could I do that? Is there more than one way? If yes, what is the easiest way?
1 Answer
It is absolutely possible.
You need to decide first how the two will be connected. Probably the easiest way would be via the network. You would then give the Pi a fixed IP address, so the android phone can find it.
An easy way to communicate would be via HTTP. You can use flask (if you're using Python on the Pi) to create a web server. With HTTP PUT you can also send commands from your Android-app to your webserver. You will need to dive into flask a bit to get it working.
-
-
Is there any tutorials or something that can show me how to send commands from my Android-app tp my webserver?– EmmaMay 30, 2021 at 18:31
-
Don't know much about Android; this is after all the Pi forum. But they tell me it is something like
android { useLibrary 'org.apache.http.legacy' }
. May 31, 2021 at 5:45