location-client

Activity Recognition stops receiving updates when phone goes to standby(screen off state)

允我心安 提交于 2019-12-03 07:46:03
问题 I am having some trouble with activity recognition. I have implemented it in an app and it works fine when the device's screen is on. I have a log entry in my Activity recognition intent service class and I can see when it gets an update.So, I know it is working fine when the screen is on. But then after the phone is put to standby(the screen is turned off) it stops detecting the uses activity. The onDisconnected() in the DetectionRequester class is not getting called, I checked using a log

Activity Recognition stops receiving updates when phone goes to standby(screen off state)

只谈情不闲聊 提交于 2019-12-02 21:10:33
I am having some trouble with activity recognition. I have implemented it in an app and it works fine when the device's screen is on. I have a log entry in my Activity recognition intent service class and I can see when it gets an update.So, I know it is working fine when the screen is on. But then after the phone is put to standby(the screen is turned off) it stops detecting the uses activity. The onDisconnected() in the DetectionRequester class is not getting called, I checked using a log post. My question: Why does my app stop tracking the uses activity after the device goes to standby mode

Android - Locations got from LocationClient doesn't support speed

别说谁变了你拦得住时间么 提交于 2019-12-02 03:41:55
I'm using the new Google LocationClient to retrieve geo locations. And I need to get speed for each point (location). What I'm doing now is: if (mLocationClient == null) { mLocationClient = new LocationClient(this, mLocationCallback, mLocationCallback); mLocationCallback.setLocationClient(mLocationClient); if (!(mLocationClient.isConnected() || mLocationClient.isConnecting())) { mLocationClient.connect(); } } Where mLocationCallback is an instance of public class LocationCallback implements ConnectionCallbacks, OnConnectionFailedListener, LocationListener {} In the function, @Override public

Android - Locations got from LocationClient doesn't support speed

旧街凉风 提交于 2019-12-02 03:16:06
问题 I'm using the new Google LocationClient to retrieve geo locations. And I need to get speed for each point (location). What I'm doing now is: if (mLocationClient == null) { mLocationClient = new LocationClient(this, mLocationCallback, mLocationCallback); mLocationCallback.setLocationClient(mLocationClient); if (!(mLocationClient.isConnected() || mLocationClient.isConnecting())) { mLocationClient.connect(); } } Where mLocationCallback is an instance of public class LocationCallback implements

DeadObjectException in GMS::LocationClient (Android)

风流意气都作罢 提交于 2019-11-30 23:13:49
On Android we have a class that wraps a LocationClient object from GMS (Google Mobile Services). (Note that LocationClient implements com.google.android.gms.common.GooglePlayServicesClient). Unfortunately the LocationClient object has a habit of throwing DeadObjectExceptions (e.g. when we invoke locationClient.getLastLocation() ), which we detect through several of our logging mechanisms. What's weird, however, is that LocationClient isn't documented as throwing DeadObjectExceptions, and furthermore I'm only able to catch said DeadObjectExceptions ~ 1/40th of the time they occur o_0. We have

Continuous location updates in background

为君一笑 提交于 2019-11-30 22:34:26
i am developing a application which will send location updates continuously from a background service. i tried following code. public class LocationService extends Service implements LocationListener, GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener { LocationRequest mLocationRequest; LocationClient mLocationClient; @Override public void onCreate() { //creating log file in mobile appendLog(DateFormat.getDateTimeInstance().format(new Date()) + ": Service created:", com.example.locationservice.Constants.LOG_FILE); mLocationRequest =

LocationClient auto reconnect at `onDisconnect`

♀尐吖头ヾ 提交于 2019-11-30 20:53:05
I tried to reconnect to LocationClient when the connection gets lost (When user clear the RAM). I tried to use this code: private final GooglePlayServicesClient.ConnectionCallbacks mConnectionCallback = new GooglePlayServicesClient.ConnectionCallbacks() { @Override public void onDisconnected() { mLocationClient.removeLocationUpdates(mLocationListener); mLocationClient.disconnect(); mLocationClient= null; mLocationClient= new LocationClient(mContext, mConnectionCallback, mConnectionFailedCallback); mLocationClient.connect(); // NULL POINTER EXCEPTION } @Override public void onConnected(Bundle

Continuous location updates in background

这一生的挚爱 提交于 2019-11-30 18:15:02
问题 i am developing a application which will send location updates continuously from a background service. i tried following code. public class LocationService extends Service implements LocationListener, GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener { LocationRequest mLocationRequest; LocationClient mLocationClient; @Override public void onCreate() { //creating log file in mobile appendLog(DateFormat.getDateTimeInstance().format(new Date()) + "

onLocationChanged not called on some devices

旧街凉风 提交于 2019-11-30 06:28:41
This is a question which has been asked numerous times but I could not find a solution that always works. I am developing an application using the Fused location provider. In the onConnected() method, I am requesting for location updates and the application logic will be initiated once a location fix is generated and onLocationChanged() is called. (Please refer to my code below). Problem onLocationChanged() method is never called on some devices. I use a Samsung Tab 2 and a Samsung Galaxy Grand for testing. This code works perfectly fine on the Tab 2 but does not work on Grand. By does not

LocationClient auto reconnect at `onDisconnect`

不问归期 提交于 2019-11-30 04:56:35
问题 I tried to reconnect to LocationClient when the connection gets lost (When user clear the RAM). I tried to use this code: private final GooglePlayServicesClient.ConnectionCallbacks mConnectionCallback = new GooglePlayServicesClient.ConnectionCallbacks() { @Override public void onDisconnected() { mLocationClient.removeLocationUpdates(mLocationListener); mLocationClient.disconnect(); mLocationClient= null; mLocationClient= new LocationClient(mContext, mConnectionCallback,