0

Im using core Android and node.js backend. I had an HTTP POST API to send user's location to server.

Since I had to frequently update the user location to server for more than 30 minutes, I'm changing the API to better use a WebSocket.

I wanted to know a few things.

  1. What is the impact of using WebSocket on battery life of Android phone? Does it drain more battery?

  2. Does WebSocket use more internet bandwidth compared to HTTP?

  3. Does WebSocket use more RAM both on Android and backend server?

Mor Blau
  • 420
  • 3
  • 15
Gissipi_453
  • 1,250
  • 1
  • 25
  • 61
  • 1
    Keeping up a TCP connection will definitely consume resources like battery and network This also depends upon which Socket you are using some of them are quite optimized and some are not . I don't think you can do much about it . Only keep the connection Up when your app is in foreground . Once it goes to background close the connection. – ADM Aug 15 '21 at 05:15
  • 1
    https://stackoverflow.com/questions/29282070/websockets-energy-consumption – ADM Aug 15 '21 at 05:24
  • 1
    Check this question asked earlier in SO. https://stackoverflow.com/questions/29282070/websockets-energy-consumption – saman Aug 15 '21 at 05:44

0 Answers0