1

When targeting android 14, we should provide at least one foregroundServiceType for each service in manifest - https://developer.android.com/about/versions/14/behavior-changes-14#fgs-types

Which foregroundServiceType should be used for ActivityRecognition?

Should I use "location" or "health"?

Here is my service:

<service
        android:name=".tracking.monitor.BackgroundDetectedActivitiesService"
        android:enabled="true"
        android:exported="false"
        android:permission="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />

1 Answer 1

1

The documentation for the health type specifically mentions activity recognition, insofar as ACTIVITY_RECOGNITION is called out as a potential permission to satisfy requirements for this foreground service type. So, I would go with that.

1
  • You are right, thank you!
    – alexC
    Commented Jul 9 at 16:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.