Android Question Best practice for foreground service at boot

Num3

Active Member
Licensed User
Longtime User
With the changes made to use receivers, what is the best practice to start a foreground service at boot (in example: background location tracking) ?
Is it using the #StartAtBoot: True in the service, or creating a receiver for android.intent.action.BOOT_COMPLETED and then start the service from that receiver when the intent comes in?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…