Questions tagged [activity-recognition]

Activity recognition tries to detect the user's current physical activity, such as walking, driving, or standing still.

Location Services sends out activity information containing one or more possible activities and the confidence level for each one.

Mark a question with this tag if the problem you have involves the use of Location Services and its receiving its PendingIntent or the implementation of FragmentActivity

From the Android.com site

208 questions
3
votes
1 answer

Improve Activity Recognition API, filtering false positives

Activity Recognition may throw quite a few false positives as you, no matter how high you raise the confidence level. So if, for example, I would like to throw a notification when the user is driving I would need build some sort of state…
Victor G
  • 399
  • 2
  • 12
3
votes
1 answer

Not receiving accessToken and RESULT_OK on onActivityResult when using Neura sdk

I'm using NeuraSdk in order to detect user events (user arrived home, user left work, etc). I'm trying to login with their sdk, and even though the login looks successful and i enter the right sms code with the phone, the accessToken isn't received…
3
votes
1 answer

Activity Recognition returning stale activity

I am currently writing an app that uses the Google's Activity Recognition API, however in my onHandleIntent method when I put a break point in there to examine the intent being passed in from the service, it is showing me stale data. The activity is…
JenniferG
  • 602
  • 1
  • 5
  • 13
3
votes
1 answer

Activity Recognition PendingIntent stop been called in the middle of the night

my application collects periodically Activity Recognition's Detected activity data. I implemented it exactly as described in the documentation , but with one minute interval. as long as the user is logged in - the application registered with a…
3
votes
1 answer

Android ActivityRecognition not working in htc oneX

I am developing an android app which makes use of Google play service activity recognition for detecting driving. While testing my app with HTC 1X, my application was getting call backs for activity recognition. Later I uninstalled and re installed…
2
votes
0 answers

Does Activity Recognition Transition API work on Wear OS?

I thought the Activity Recognition Transition API didn't work on Wear OS. Does Wear OS support the Activity Recognition Transition API? I checked whether the Activity Recognition Transition API works on Wear OS devices by referring to this…
Kei
  • 134
  • 5
2
votes
0 answers

ActivityTransitions API not calling BroadcastReceiver on Samsung Deivce

I implemented the Activity Transitions API with a PendingIntent and a BroadcastReceiver as seen below. The code works perfectly fine on a Pixel 3a. However, on a Samsung A32 and Samsung S22 Pro, the Broadcast receiver is never reached, eventhough…
2
votes
2 answers

When i was trying to developing GPS tracking Android APP with Google Activity Recognition Transition API, I had a API-working stop issue

When i was trying to developing GPS tracking Android APP with Google Activity Recognition Transition API, I had a API-working stop issue. I thought that it is a problem of device-model compatible but not sure exactly about it because it occurs very…
2
votes
1 answer

Android 12 - Activity Recognition With broadcast receiver in background not working

I am trying to get user activity states by ActivityRecognition API and it works in foreground and for few hours in background too (When user exit the app) but after more than 4/5 hours it stop sending user activity states by ActivityRecognition…
androidXP
  • 1,692
  • 3
  • 27
  • 58
2
votes
2 answers

BroadcastReceiver not receiving any activity recognition broadcast

My main activity registering broadcast for Activity Recognition but and don't see any calls to Broadcast Receiver's onReceive method. I am not able to figure out why it's not working as expected. I am testing on Real device with android 11 (API 30)…
Ritu
  • 518
  • 2
  • 12
  • 35
2
votes
0 answers

ActivityRecognition with workmanager for background task

I am using IntentService before to make my ActivityRecognition work in the background for location updates but since Android 9+ IntentService deprecated and it's no longer working in recent Android versions. So I tried to use WorkManager but I am a…
Ritu
  • 518
  • 2
  • 12
  • 35
2
votes
2 answers

Android Sleep API - not getting data

I use the Sleep API in my Kotlin Android app. To get sleep data, I am following these steps: Getting the android.permission.ACTIVITY_RECOGNITION permission from the user Successfully registering to both SleepSegmentEvent and…
2
votes
1 answer

Not able to stop listening to stream in flutter

I'm using a library for activity recognition in flutter which creates a stream for activity recognition data that comes from the sensors of the phone, I'm able to start stream but not able to stop it when tab from bottom navigation bar changes. I'm…
Karan Mehta
  • 1,442
  • 13
  • 32
2
votes
1 answer

Android ACTIVITY_RECOGNITION on targetAPI = 29 and device's Android ver. < 10

My question is similar to Android 10 request permission for ACTIVITY_RECOGNITION in a way that I also do not have a permission dialog showing on a device, but conditions are different. My app is targeting API 29. In manifest I have
2
votes
0 answers

How can i convert IntentService to a background service which should run even after app is killed

I am working on DetectedActivity and i am currently get successful results on that. Now i want to get user's detected activity(in log or toast) while my app is killed. I have read the google document for ActivityRecognization api which is using…