gps

Battery optimizations (wakelocks) on Huawei EMUI 4.0+

 ̄綄美尐妖づ 提交于 2019-11-30 16:57:19
问题 Good day, situation: I'm developing Android application that serve as sport tracker/navigation app - so it require permanent connection to GPS and also permanent awake device. Recording is done every second. Current solution working for years is thanks to wakelocks that keep device awake. Doze mode in Android 6.0+ complicate situation, but it is not this case. On Huawei device is probably different type of optimization. Here is part of log: 10-10 10:33:18.462 1014-384 D/PFW

How to get gps coordinates every minute in Android?

扶醉桌前 提交于 2019-11-30 16:07:00
I want to get my coordinates every minute, even if a user is not moving. So i used requestLocationUpdates with the following parameters: locMgr.requestLocationUpdates( LocationManager.GPS_PROVIDER, 60000, // minTime in ms 0, // minDistance in meters PosljiLokacijo.this); But when i test it on my HTC Hero (2.1 Android) and i am not moving, onLocationChanged() is never called. If i change minDistance to 1, then i get a few updates at start but after that, they come in very unregular intervals. How should i choose these 2 parameters (minTime and minDistance) to receive coordinates every minute? I

Android - using LocationManager does not give a geo fix

岁酱吖の 提交于 2019-11-30 16:05:23
I am trying to get the GPS location of my G1 using the following code In Activity MyLocationListener myListener = new MyLocationListener(); LocationManager myManager = (LocationManager)getSystemService(LOCATION_SERVICE); myManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 0, myListener); This is the LocationListener class public class MyLocationListener implements LocationListener { private static double latitude; private static double longitude; @Override public void onLocationChanged(Location arg0) { latitude = arg0.getLatitude(); longitude = arg0.getLongitude(); } @Override

Why is my CLLocation speed so inaccurate?

一个人想着一个人 提交于 2019-11-30 15:59:39
I´m playing a bit with the iPhone SDK and I want to show the current speed in my application. There are so many apps that can do that really precise, especially for low speeds like running or biking. The best I've seen is RunKeeper. But, in my application, the speed is absolutely inaccurate. In low speeds it is always null, and only at higher speeds it shows some values but they are rarely updated and not really useful. - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { if (newLocation.timestamp >

Redirect to location settings using cordova in android

只谈情不闲聊 提交于 2019-11-30 15:45:34
问题 Here is the requirements what i am trying to implement in my cordova android application When user enters the home page check to see if the gps is enabled or not. If not enabled i want to point the user to turn on the location settings. first part is made easily with GPS detector plugin and second part is implemented using the web intent plugin.But its not working as i expected. if(!gps){ //gps is disabled try to show the location setting using webintent plugin window.plugins.webintent

Calculate distance in (x, y) between two GPS-Points

一曲冷凌霜 提交于 2019-11-30 15:44:03
问题 I'm looking for a smooth way to calculate the distance between two GPS Points, so I get the result like: "You have to go x meters up and y meters to the left - so I can work with a 2d-coordinate system, where I have my position as (0,0) and the other positions is showing the distance in (x, y) in meters from my position. My idea was to calculate the distance between the points using the haversine formula. (This returns my hypotenuse) In addition to that, I'm calculating the bearing between

longitude reading measured in degrees with a 1x10^-7 degree lsb, signed 2’s complement

谁都会走 提交于 2019-11-30 15:41:27
I am receiving data from a gps unit via a udp packet. Lat/Lng values are in hex. Example Data 13BF71A8 = Latitude (33.1313576) BA18A506 = Longitude (-117.2790010) The documentation explains that longitude/latitude readings are measured in degrees with a 1x10^-7 degree lsb, signed 2’s complement. For the Latitude I can convert using this formula: 13BF71A8 = 331313576 * 0.0000001 = 33.1313576 This code works for Lat but not for Lng: function convertLat(h){ var latdec = parseInt(h,16); var lat = latdec * 0.0000001; return lat; } console.log("LAT: " + convertLat("13BF71A8")); I am having trouble

How to calculate points on a circle on the globe centred on GPS coordinates?

半腔热情 提交于 2019-11-30 15:41:13
问题 Draw a circle in KML How do you take the GPS coordinates of a point on the globe (say in decimal degree format) and generate the coordinates for a polygon approximating a circle centred on that point? A polygon with 20+ data points looks like a circle. The more data points - the better looking the circle. I am writing a program that will generate KML and dont know how to calculate the coordinates of the polygon vertices. Example of data inputs: Latitude, Longitude, Circle radius (in feet),

How to calculate points on a circle on the globe centred on GPS coordinates?

馋奶兔 提交于 2019-11-30 15:35:24
Draw a circle in KML How do you take the GPS coordinates of a point on the globe (say in decimal degree format) and generate the coordinates for a polygon approximating a circle centred on that point? A polygon with 20+ data points looks like a circle. The more data points - the better looking the circle. I am writing a program that will generate KML and dont know how to calculate the coordinates of the polygon vertices. Example of data inputs: Latitude, Longitude, Circle radius (in feet), NumberOfDataPoints 26.128477, -80.105149, 500, 20 arx I don't know if this is the simplest solution and

Switching between gps and network provider according to the availability

巧了我就是萌 提交于 2019-11-30 15:34:58
public void onCreate() { locationListener = new GeoUpdateHandler(); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); try { gps_enabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); network_enabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); } catch (Exception ex) { } if(gps_enabled) { locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, TIME_DURATION, 100, locationListener); } else if(network_enabled) { // Checking for GSM locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, TIME