Android Question Communicating with remote server

Devv

Active Member
Licensed User
Longtime User
hi
I'am making an anti theft app.
the app must always contact my http server to get commands

I was using httpsultis and a timer ,each 3 mins to do http get and check my site for commamds.

but this method is so battery consuming on some phones it took about 25% of the battery

any other methods that is less batter hungry ? with keeping a 3 minutes refresh rate

all ideas are welcomed
 

Roycefer

Well-Known Member
Licensed User
Longtime User
Using WebSockets might cut down on the bandwidth usage but I suspect the bulk of the battery draining isn't from powering the radio unnecessarily with the overhead of HTTP GET requests but rather that 3 minute refresh rates are preventing the CPU from entering sleep mode. But it can't hurt to try it and see if it improves battery performance.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
I also think, it is the timer that consume battery a lot.

Why not change timer to some action, for example when users clicked menu, app contact your server, etc.
 
Upvote 0
Top