location-client

DeadObjectException in GMS::LocationClient (Android)

跟風遠走 提交于 2019-12-19 04:06:35
问题 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

Want to create google map navigation in my application - custom way

柔情痞子 提交于 2019-12-17 20:57:06
问题 I have created an application in which I am trying to show user's movement by animating marker position. Using Google map V2. Location updates using location client. Animating marker using new location. But comparing with Google map navigation, there is no continuity in rendering navigation. Can anyone suggest a better approach? Thanks! 回答1: For continuity, I think you need to fetch regular location updates from location client by giving location request like this. LocationRequest request =

setFastestInterval(long milis) not working

时间秒杀一切 提交于 2019-12-14 02:38:37
问题 I want to slow the update rates as soon as I got a location precise enough for my needs: @Override public void slowUpdateRate() { /* * Set the update interval */ Dbg.v(TAG,"****************************"); Dbg.e(TAG, "-- SLOW update rate"); Dbg.v(TAG,"****************************"); stopUpdates(); mLocationRequest.setInterval(1500000); mLocationRequest.setFastestInterval(150000); mLocationClient.requestLocationUpdates(mLocationRequest, this); The method is called but I still got updates every

Check if Location is unavailable in Android Location Client

非 Y 不嫁゛ 提交于 2019-12-13 04:37:49
问题 I would like to check if Location Client is able to provide any location. Is there any way to do so, apart from calling normal location system service? 回答1: The accepted answer was correct at the time. But in recent times things have changed with the availability of the SettingsApi It allows you to check if the location services are available on the device and there is a complete example provided by google on github that shows how to use this API. The sample code will prompt the user to

locationclient.getlastlocation() always returns null on emulator

牧云@^-^@ 提交于 2019-12-10 21:56:19
问题 I am new into Android world. I was just referring this tutorial from Google: http://developer.android.com/training/location/retrieve-current.html Program compiles fine and launches application on emulator, but when I try to find mLocationClient.getLastLocation() it returns null, ALWAYS I searched for almost a day and ahve already tried sending parameter from DDMS, telnet, switching google MAPs but still no success. Please help me out. 回答1: What eventually worked for me was setting a location

Do Android Geofences remain active until removed/expired or only until my PendingIntent is launched

岁酱吖の 提交于 2019-12-10 03:45:55
问题 I'm about to implement a feature with geofences and before I get any serious work done, I need to know whether geofences remain active after the first transition. The core of the feature is: every time I'm within x meters of point P (call this Area A ), I want Action B to occur. What I need to know is Do I just have to add a geofence with Geofence.NEVER_EXPIRE and rest assured that I will get a PendingIntent every time I enter the specified area regardless of elapsed time, reboots, etc OR Do

Google location API: request location updates with pending intent?

时光毁灭记忆、已成空白 提交于 2019-12-06 22:49:54
问题 I have started to implement the Google Location API using this tutorial. I've managed to get it to work in my application quite fine, it updates my location at the right intervals etc. Now I am working on how to update my location when the device is in sleep mode. According to the documentation, this method is the way to go: public void requestLocationUpdates (LocationRequest request, PendingIntent callbackIntent); My question is, how do I set up this PendingIntent, and how do I handle it? I

Do Android Geofences remain active until removed/expired or only until my PendingIntent is launched

孤街浪徒 提交于 2019-12-05 04:02:21
I'm about to implement a feature with geofences and before I get any serious work done, I need to know whether geofences remain active after the first transition. The core of the feature is: every time I'm within x meters of point P (call this Area A ), I want Action B to occur. What I need to know is Do I just have to add a geofence with Geofence.NEVER_EXPIRE and rest assured that I will get a PendingIntent every time I enter the specified area regardless of elapsed time, reboots, etc OR Do I have to re-register this geofence once I exit Area A in order to get notified the next time I enter

Should you connect and disconnect to Google Play Services in each activity?

天大地大妈咪最大 提交于 2019-12-05 02:05:06
问题 I am writing an application which needs a connected location client in all the activities. How do the manage the state of the client? I want to call the mLocationClient.connect() only once to avoid hassle, and should be able to remove location updates / disconnect when the application stops. How do I keep the location client connected across all activities, assuming I have connected to it in the splash screen Activity ? Another question that arises here is, when I resume the paused

Should you connect and disconnect to Google Play Services in each activity?

£可爱£侵袭症+ 提交于 2019-12-03 16:31:23
I am writing an application which needs a connected location client in all the activities. How do the manage the state of the client? I want to call the mLocationClient.connect() only once to avoid hassle, and should be able to remove location updates / disconnect when the application stops. How do I keep the location client connected across all activities, assuming I have connected to it in the splash screen Activity ? Another question that arises here is, when I resume the paused application (not recreation), the app won't start with the splash screen. How do I maintain the connection in