Search code examples
pythonandroidrestwebsocketcommunication

Proper communication


I'm wondering which communication method use in my app. There will be python server displaing data from website and from android app. That is easier part where I will use REST. But then I need communication back to android app from server and also from server to second android app. I thought about sockets. Is it proper way? Mayby REST isn't good choice also?

Give my some tips please. Thank you on advice.


Solution

  • Using sockets can be a suitable method for bidirectional communication between your Python server and Android apps.

    But you can consider `the below list of communication methods for your app:

    • REST for data retrieval.
    • WebSocket for real-time bidirectional communication.
    • Push Notifications for server-to-app updates.
    • Long Polling with REST for simple real-time updates.
    • MQTT for publish-subscribe communication.

    To say, WebSocket is often a good choice for real-time communication,