activity-recognition

Activity Recognition API does not work continuously

血红的双手。 提交于 2019-12-02 07:17:31
问题 I'm testing Activity Recognition API in 2 apps : Google sample code and implementation of this code in my app. The problem is both apps keeps getting activity recognition fine but after a few hours the intent service stops and i'm not getting any activity recognition from both of them. Any idea why the intent service stops even though i've tested geofencing api with intent service and it's working forever without stopping? 回答1: Your IntentService might "stop", I would say "fall asleep"

Android Activity Recognition not working with Nexus 5

北战南征 提交于 2019-12-02 07:14:48
I had a code working that was using Google's Activity Recognition Updates. Now all of a sudden these seem to send updates either several times per second or never although requested every 20 seconds. I haven't changed the code and checked earlier versions but got the same problem. I built a minimal example from the tutorial but also get no activity updates with my Nexus 5 device. With my HTC Desire (MildWild 5.0 based on Android 2.3.7) it works perfectly fine. I suspected Google Play Services but both phones have version 4.2.43 installed MainActivity: package com.example.testactivities; import

Android ActivityRecognition java.lang.NullPointerException: Appropriate Api was not requested

半世苍凉 提交于 2019-12-01 16:56:07
I'm attempting to follow Google's Activity Recognition example. In the example they start the activity recognition when you click a button, however I'd like to just start it up when the app starts - so I tried putting it in the onConnected method. However, it ends up throwing a null pointer exception. Here's how I'm calling it: @Override public void onConnected(Bundle connectionHint) { Log.d(TAG, "onConnected"); try { ActivityRecognition.ActivityRecognitionApi.requestActivityUpdates( mGoogleApiClient, UPDATE_INTERVAL_IN_MILLISECONDS, getActivityDetectionPendingIntent() ).setResultCallback(this

Activity Recognition does not work after phone goes asleep

耗尽温柔 提交于 2019-12-01 00:23:10
Disclaimer: this is not duplicate of Activity Recognition stops receiving updates when phone goes to standby(screen off state) because I'm already using that approach and it does not help. Problem: It seems that Activity Recognition service stops working and is not sending any updates when device goes asleep. It works OK (recognized activities are stored to sqlite) when device is not asleep but as soon as I press power button on HTC M8, nothing is stored from this moment until I wake up the device but pressing power button again. Some details how I'm doing activity recognition: Requesting

Activity Recognition does not work after phone goes asleep

∥☆過路亽.° 提交于 2019-11-30 19:41:11
问题 Disclaimer: this is not duplicate of Activity Recognition stops receiving updates when phone goes to standby(screen off state) because I'm already using that approach and it does not help. Problem: It seems that Activity Recognition service stops working and is not sending any updates when device goes asleep. It works OK (recognized activities are stored to sqlite) when device is not asleep but as soon as I press power button on HTC M8, nothing is stored from this moment until I wake up the

Failed to crunch file - Android studio (app:mergeDebugResources)

放肆的年华 提交于 2019-11-28 06:11:52
i am currentyl trying to implement Google ActivityRecognitionApi. However i get following errors: Error:Failed to crunch file C:\Users\marschall\Desktop\googlesamples-android-play-location-2ed2964\ActivityProject\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-cast-framework\10.0.1\res\drawable-xxhdpi-v4\quantum_ic_forward_30_grey600_36.png into C:\Users\marschall\Desktop\googlesamples-android-play-location-2ed2964\ActivityProject\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\quantum_ic_forward_30_grey600_36.png Error:Execution failed for task ':app