fusedlocationproviderapi

FusedLocationApi Background Location service stops receiving updates randomly

烈酒焚心 提交于 2019-12-05 15:36:25
i'm trying to use FusedLocationApi with pending intent to get period location updates so i can send the data to some server for processing. Everything works. However, there are some instances where the broadcast just stops receiving. I would need to restart the service again in order for it to continue. I already have the service onStartCommand to return START_STICKY so even if the app is killed it should start the service again. Furthermore, I also added a Boot Completed Intent Receiver so if the phone died and user restarted phone it would restart my service. So it seems everything is fine

Is Fused Location Provider good choice?

一个人想着一个人 提交于 2019-12-05 09:12:10
I am developing an application where I want to use Fused Location Provider. But I have some doubts, and couple of questions. When GPS is off and I set priority to HIGH, does that mean that the GPS will be automatically turned on, or not? Can I set UpdateLocation with Fused provider with HIGH priority on demand to save battery at least a little bit? How can I know what Fused provider is using (is it a GPS or a network provider)? And finally Is Fused provider really the best choice for android location? Are there any negative points about it? What is your opinion? Thanks in advance. blackkara

Unfortunately, MyApp has stopped - no error logs in logcat

百般思念 提交于 2019-12-05 03:19:31
Every once in a while I get: Unfortunately, MyApp has stopped. Problem is easy to solve if you have some logs , but in my case logcat has absolutely no message of error (it has normal messages published by my app and other exceptions are shown there but not this one which causes this app has stopped ). Is there any chance I can solve this problem? The good thing is I can quite easily reproduce it, thus I'm trying to put as many information I can to logcat and then investigate what happened. I have ACRA up and running (other exceptions are caught by it but not this app has stopped ). When it

Android cannot resolve method requestLocationUpdates FusedLocationProviderAPI

狂风中的少年 提交于 2019-12-04 16:29:28
问题 I'm attempting to follow the Android Receiving Location Updates tutorial. The example code is here on Github. Everything is working except for this line: LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this); It's throwing a cannot resolve method requestLocationUpdates error. I don't see anything in the documentation, but I'm pretty new to Android so might be missing something :). Here's the full code. Any ideas where I'm going wrong? Thanks!

Android O, Background Service is running for more than 30 minutes. Why?

你说的曾经没有我的故事 提交于 2019-12-04 08:20:35
I am using FusedLocationProvider API to register some Geofences with PendingIntent, when my app gets started (app was manually killed to trigger this behavior) via Geofence event, I start a background service to do some work. In this Service I create a separate background thread to do some long running tasks and I acquire a wake-lock so that I am sure my tasks are completed. The Service keeps running for longer period of times (30 - 50 minutes) even though It shouldn't be. It shouldn't be white-listed and keep itself running for longer period of times according to my understanding of recent

Fused Location Provider not getting location unless GPS is on

一个人想着一个人 提交于 2019-12-03 16:32:38
问题 So I have implemented the new Fused Location Provider API to get a location of the user but for some reason, I cannot get any location unless the GPS is on. Not always, will users have their GPS on and I would like to not have to ask them to turn their GPS on every time the load the app. How can I tell the API to give me a location with whatever provider it has available? Here is my code: public class FusedLocationService implements LocationListener, GoogleApiClient.ConnectionCallbacks,

Fused Location Provider not getting location unless GPS is on

拟墨画扇 提交于 2019-12-03 05:39:03
So I have implemented the new Fused Location Provider API to get a location of the user but for some reason, I cannot get any location unless the GPS is on. Not always, will users have their GPS on and I would like to not have to ask them to turn their GPS on every time the load the app. How can I tell the API to give me a location with whatever provider it has available? Here is my code: public class FusedLocationService implements LocationListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { public interface OnLocationChangedListener { public void

Android: Check if Location Services Enabled using Fused Location Provider

[亡魂溺海] 提交于 2019-12-03 04:24:33
问题 According to the Android documentation: The Google Location Services API, part of Google Play Services, provides a more powerful, high-level framework that automatically handles location providers, user movement, and location accuracy than the platform location API in android.location . But using the fused location provider (from location APIs in Google Play services) I do not know how to check if the user has the location enabled or disabled. Using the old android.location it was easy:

Android: Check if Location Services Enabled using Fused Location Provider

十年热恋 提交于 2019-12-02 17:37:30
According to the Android documentation: The Google Location Services API, part of Google Play Services, provides a more powerful, high-level framework that automatically handles location providers, user movement, and location accuracy than the platform location API in android.location . But using the fused location provider (from location APIs in Google Play services) I do not know how to check if the user has the location enabled or disabled. Using the old android.location it was easy: locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); locationManager.isProviderEnabled

Wierd and very unexpected issue with location.getAccuracy()

谁都会走 提交于 2019-12-02 07:32:31
问题 Problem: I have tried using the new FusedLocationProviderClient and the deprecated FusedLocationApi to receive location updates on my app using a Sony Xperia Z2 and Huawei Honor 8 . Everything works fine initialy. However it seems that after x amount of location requests the accuracy number NEVER drops below 10.0 using location.getAccuracy(); // 10.0 What I have tried: Uninstalling and reinstalling the app does no difference. Restarting the phone, same result. Yes I have LocationRequest