Swierszczu
Swierszczu

Reputation: 169

Android foreground service amount limits

I am currently working on an application designed for runners. Functionality of my app depends on 3 services: Bluetooth, Gps, Training. Bluetooth and Gps starts with an app and goes foreground together with foreground training service. My question:

Is there a limit here regarding how many such services I can add? Will having more services that can work also in foreground make my application too resource consuming? As far as i know the most popular apps use only one service to manage tasks which i mentioned.

Upvotes: 1

Views: 565

Answers (1)

卡尔斯路西法
卡尔斯路西法

Reputation: 133

Is there a limit here regarding how many such services I can add?

No limit.if memory enough and you willing to handle data exchange.

Will having more services that can work also in foreground make my application too resource consuming?

Resource consuming depends on your actual code.Empty service less resources are consumed(Far lower than activity or fragment,because no ui).

As far as i know the most popular apps use only one service to manage tasks which i mentioned.

  1. Multiple serive need handle data transmission.(you maybe transmission data[from gps] by bluetooth.).
  2. Users need to know what you are doing("The running service is recording your running status"), not that you are using Bluetooth or GPS, this is what the system does

Foreground service must show a notification,so you not should tell user you is using gps,system is already working on it.

Users may think that you are wasting their phone's battery, even though you may not have done so.

so you can do,but I suggest you use a service that calls three modules. of course if you need upload or other service,you should run new service.

Upvotes: 0

Related Questions