gps

How to check for the presence of a GPS sensor?

China☆狼群 提交于 2019-12-01 18:58:57
I'm writing a method that will return true if there's a GPS sensor present and enabled, but returns false if it's absent or switched off. It's proving hard because... hasSystemFeature("FEATURE_LOCATION_GPS") // on PackageManager Returns false, whether the device has a GPS or not. So even on a device that has one, and it's switched on, it still returns false. Seems completely wrong to me, but I can't see why. isProviderEnabled("gps") // on LocationManager Returns true, even on a device I have here that has no GPS hardware at all. That also seems completely counter-intuitive. I accept these

How to check for the presence of a GPS sensor?

孤街醉人 提交于 2019-12-01 18:28:51
问题 I'm writing a method that will return true if there's a GPS sensor present and enabled, but returns false if it's absent or switched off. It's proving hard because... hasSystemFeature("FEATURE_LOCATION_GPS") // on PackageManager Returns false, whether the device has a GPS or not. So even on a device that has one, and it's switched on, it still returns false. Seems completely wrong to me, but I can't see why. isProviderEnabled("gps") // on LocationManager Returns true, even on a device I have

How to get notified when the gps in disabled by the user in android?

十年热恋 提交于 2019-12-01 18:21:50
I am creating an app which uses GPS. For the first time in onCreate() I am checking whether the GPS is enabled or not. And if its not enabled then I am sending the user to the setting menu to set the GPS enabled. Once the GPS is enabled then I starts executing my stuff. But if in between the user stops the GPS scrolling on Notification manager then how would I know this? Because my method executed only once when the GPS is not enabled. After that its not getting executed when it is disabled again. I just want to know whenever in between the work the GPS is disabled by the user. Just this

How to get notified when the gps in disabled by the user in android?

我只是一个虾纸丫 提交于 2019-12-01 18:16:07
问题 I am creating an app which uses GPS. For the first time in onCreate() I am checking whether the GPS is enabled or not. And if its not enabled then I am sending the user to the setting menu to set the GPS enabled. Once the GPS is enabled then I starts executing my stuff. But if in between the user stops the GPS scrolling on Notification manager then how would I know this? Because my method executed only once when the GPS is not enabled. After that its not getting executed when it is disabled

iOS detect mock locations

点点圈 提交于 2019-12-01 17:33:28
Currently I'm working on an App which geolocation capabilities are its most important feature. Actually we're very concerned about getting GPS values mocked up. I've read a lot of comments regarding mocking locations on both iOS and Android and most of them tend to explain an unjailbroken iOS device can't mock locations, but the truth is I've created another project, with a GPX file to mock up location on that project and when executed, the entire system believes I'm in another city. All my locationManager callbacks tell me I'm on the mocked location with the proper timestamp, faking the

Convert latitude and longitude to ECEF coordinates system

谁都会走 提交于 2019-12-01 16:56:51
I am studying pArk Apple sample code, and how it is works. anyone knows how convert the latitude and longitude to ECEF coordinates, and Covert ECEF to ENU coordinates centered at given lat, lon functions are work? I just want to understand what is going on in this function! thanks. void latLonToEcef(double lat, double lon, double alt, double *x, double *y, double *z) { double clat = cos(lat * DEGREES_TO_RADIANS); double slat = sin(lat * DEGREES_TO_RADIANS); double clon = cos(lon * DEGREES_TO_RADIANS); double slon = sin(lon * DEGREES_TO_RADIANS); double N = WGS84_A / sqrt(1.0 - WGS84_E * WGS84

Sync Time for Recording Data on Multiple Android Devices

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 16:30:41
This question may be slightly long-winded, but is open for many suggestions. Problem Statement: We have several API level 8 (Android 2.2) MyTouch devices that we will be using for recording acceleration data at an amusement park, namely on a roller coaster. We also have a visualization feature that allows us to plot and view the accelerometer points as a function of time that they were recorded at. Here is where we have a dilemma! The system times on the Android devices aren't all the same, nor can they be set to the same time with millisecond precision (only manually with minute precision,

Is there a way to determine the actual time and date in iOS (not the time of the device)

假装没事ソ 提交于 2019-12-01 15:13:59
In iOS, I need to know the actual time (UTC), not the time of the device. In other words, it should not be possible for the user to tamper with the time or date. Anything that requires a network connection is not good (so accessing a time server is not an option). AFAIK, there are 2 theoretical ways of achieving this: Use the timestamp from the GPS satellite signal Get the current time from the carrier Problem is that this information is not exposed by any API in iOS. Is there another way? Most solutions you could possibly find (including getting GPS data from CoreLocation to access the time

Difficulty in sending location of user 1 to user 2 and user 2's location to user 1?

徘徊边缘 提交于 2019-12-01 14:44:12
I have a code which sends location of user 1 to user 2 and user 2's location to user 1 . The location of user 1 is send perfectly to user 2 and user 2 is even sending a message back to user 1 but the location which it is sending is the location of user 1 not his (user 2) location. Here is my code: package com.example.gui; import android.app.Activity; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.database.Cursor

Converting coordinates into map addresses

試著忘記壹切 提交于 2019-12-01 14:33:15
I am developing a GPS Server and tracking system: How can I convert latitudes and longitudes data got from a GPS tracking device into address data so that the client application report be displaying road names instead of coordinates? How can I map the coordinate data so that tracker position be displayed on a map i.e. google maps or vector maps? I'll highly appreciate your answers or suggestions Use a reverse geocoder. http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding Use a mapping API like Google Maps. http://code.google.com/apis/maps/documentation/javascript/ rubo77