android-gps

Geofence - problem in triggering 'GEOFENCE_NOT_AVAILABLE'

混江龙づ霸主 提交于 2019-12-08 02:25:49
问题 I do app with geofencing use and since I started to work with it I get to broadcastReceiver the transitions and when I turned off the GPS location I got an alert with code GEOFENCE_NOT_AVAILABLE and I started a service to reregister the geofences when I will turn on the GPS. Now I took a few days break and suddenly my broadcastReceiver doesn't get alerts when I turn off the GPS. I don't understand why? *when I enter/exit from location (like I defined in the geofences init) I trigger the

Geofence - problem in triggering 'GEOFENCE_NOT_AVAILABLE'

▼魔方 西西 提交于 2019-12-06 05:05:32
I do app with geofencing use and since I started to work with it I get to broadcastReceiver the transitions and when I turned off the GPS location I got an alert with code GEOFENCE_NOT_AVAILABLE and I started a service to reregister the geofences when I will turn on the GPS. Now I took a few days break and suddenly my broadcastReceiver doesn't get alerts when I turn off the GPS. I don't understand why? *when I enter/exit from location (like I defined in the geofences init) I trigger the alerts, the problem is just at the triggering of the GEOFENCE_NOT_AVAILABLE alert. I will glad if anyone can

Getting W/Activity: Can request only one set of permissions at a time

拟墨画扇 提交于 2019-12-04 03:04:05
I made an app that have a request for camera and GPS, but when I execute I am getting this warning several times with less than 1 second of each other. W/Activity: Can reqeust only one set of permissions at a time) Can some one tell me why? @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); mStatusCamera = intent.getStringExtra("camera"); mScannerView = new ZXingScannerView(this) { @Override protected IViewFinder createViewFinderView(Context context) { return new CustomZXingScannerView(context); } }; List

How does some apps(wechat) ignore fake location and then detect the real one?

对着背影说爱祢 提交于 2019-12-03 01:05:37
I have installed a fake location app and set my location different. Then opened Google Maps and Wechat app, Google Maps shows my location as what i set(fake) Wechat app ignores fake location and detects real location (how?) Then i wanted to prevent wechat analyze my previously received real locations and new fake location. Uninstalled Wechat Restarted my device Set my location as fake Installed Wechat again But same result, it detects my real location. I really want to understand how they do this. Any ideas? What i have tried Gps provider spoof Network provider spoof Fused location provider

Android Service stops working, when app isn't on the foreground

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 09:17:48
问题 I've got a little problem: I recieve from a Service a speed value given by the LocationListener. But when i close the ui of my app then the locationlistener stops sending updates. Does anyone have an idea what to do? I need it to continue the updates, even if the app is not in use... Here is my code: public class BackroundService extends Service { //initializing the Location Manager and Listener LocationManager locationManager; LocationListener locationListener; @Nullable @Override public

Android requestLocationUpdates with GPS null

只愿长相守 提交于 2019-12-02 07:10:59
问题 private void getLocation(){ locationManager = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE); List<String> providers = locationManager.getAllProviders(); for (String provider : providers) { Log.e("GPS_provider: ", provider); } Criteria criteria = new Criteria(); bestProvider = locationManager.getBestProvider(criteria, false); Log.e("Best_provider: ", bestProvider); locationListener = new LocationListener() { public void onLocationChanged(Location location) { //

Android Service stops working, when app isn't on the foreground

房东的猫 提交于 2019-12-02 06:46:34
I've got a little problem: I recieve from a Service a speed value given by the LocationListener. But when i close the ui of my app then the locationlistener stops sending updates. Does anyone have an idea what to do? I need it to continue the updates, even if the app is not in use... Here is my code: public class BackroundService extends Service { //initializing the Location Manager and Listener LocationManager locationManager; LocationListener locationListener; @Nullable @Override public IBinder onBind(Intent intent) { return null; } @SuppressLint("MissingPermission") @Override public void

Android requestLocationUpdates with GPS null

梦想的初衷 提交于 2019-12-02 04:46:34
private void getLocation(){ locationManager = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE); List<String> providers = locationManager.getAllProviders(); for (String provider : providers) { Log.e("GPS_provider: ", provider); } Criteria criteria = new Criteria(); bestProvider = locationManager.getBestProvider(criteria, false); Log.e("Best_provider: ", bestProvider); locationListener = new LocationListener() { public void onLocationChanged(Location location) { // Called when a new location is found by the network location provider. Log.e("Loc_changed", ""+ location

Getting Location Updates based on time interval or Displacement

旧街凉风 提交于 2019-12-01 20:09:34
I am using Fused Location Api to get location updates. When I set x seconds as time interval then I got onLocationChanged() called after every x seconds. And when I set 10 meter as minimumDisplacement then onLocationChanged() is not called until user moves 10 meter from its original position. But I need to have onLocationChanged() called when either x seconds passed or 10 meter distance covered. any idea how I can achieve this. My Code private Location mLastLocation; public static final int REQUEST_LOCATION = 1006; LocationRequest mLocationRequest; private static final long POLLING_FREQ = 1000

Getting Location Updates based on time interval or Displacement

社会主义新天地 提交于 2019-12-01 19:08:34
问题 I am using Fused Location Api to get location updates. When I set x seconds as time interval then I got onLocationChanged() called after every x seconds. And when I set 10 meter as minimumDisplacement then onLocationChanged() is not called until user moves 10 meter from its original position. But I need to have onLocationChanged() called when either x seconds passed or 10 meter distance covered. any idea how I can achieve this. My Code private Location mLastLocation; public static final int