Mischaila
Mischaila

Reputation: 39

Android Service or Broadcast Receiver

My app is for tracking, have to send to php all I got. I have methods such as postData to php, my location listener class and getMyPhoneNumber. My question is what should I choose to develop that app? I have read Android Service and Broadcast Receiver documents and I still can't figure it out. Which one of them is more suitable? PS, Thanks in advance

Upvotes: 0

Views: 532

Answers (1)

Shailendra Singh Rajawat
Shailendra Singh Rajawat

Reputation: 8242

suitable depends upon requirment . if you want to receive particular broadcast or in other words want to do some operation on specific event like location change use broadcase Reciever while if you want something to happen consistently use srvice .

service will always run (in background) while BroadCastReceiver will receive related broadcast and run

Upvotes: 1

Related Questions