gps

How get the current latitud and longitud without use getLastKnownLocation method in Android?

烈酒焚心 提交于 2019-12-05 16:00:37
I am trying to get the current position of the phone, for this I use the GPSTracker tutorial , the problem is always use the method getLastKnownLocation and return older position. if (isNetworkEnabled) { locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this); Log.d("Network", "Network"); if (locationManager != null) { location = locationManager .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); if (location != null) { latitude = location.getLatitude(); longitude = location.getLongitude(); } } } // if GPS

iPhone running periodical process in the background - battery optimized way

隐身守侯 提交于 2019-12-05 13:28:18
I want to run a specific task in the background. This task takes few seconds to complete (it writes some GPS location data to a file). This task should run once every 1 hour. As I understand from the SDK, I do not have a way to INITIATE something in the background unless I run Location Services forever. When this service runs, it gives me an event from time to time, and I'm able to run my code during these calls. I tried it, and even with the minimal precision possible, my battery goes down very quickly. So, I'm looking for a way to run Location Services for few seconds every hour. All the

Getting current location in Android Studio app

谁说我不能喝 提交于 2019-12-05 12:51:52
I am developing my first Android app which should get the latitude and longitude of an android device and send it via a web service to a template document. I followed the guide of getting the location from http://developer.android.com/training/location/retrieve-current.html . This is the code from my .java class: import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.location.Location; import android.location.LocationManager; import android.os.Bundle; import android.provider.Settings; import android.support.v7.app.AlertDialog;

Parsing code for GPS NMEA string

会有一股神秘感。 提交于 2019-12-05 12:50:28
i am trying to parse the incoming GPGGA NMEA GPS string using Arduino uno and below code. What i am trying to do is that i am using only GPGGA NMEA string to get the values of Latitude, longitude and altitude.In my below code, i had put certain checks to check if incoming string is GPGGA or not, and then store the further string in a array which can be further parsed suing strtok function and all the 3 GPS coordinates can be easily find out. But i am unable to figure out how to store only GPGGA string and not the further string.I am using a for loop but it isn't working. I am not trying to use

Fused Location sometimes STOPS

吃可爱长大的小学妹 提交于 2019-12-05 12:21:07
I've been working on an app that tracks the user's position. For this I have used the google play services location module (a.k.a. fused location). All in all everything works fine. BUT sometimes, completely random, I no longer receive location updates from the google location services, at all! I mean, my app is working fine, but no location updates. Not only that,if I start up google maps it can't get a fix on my location (even with GPS turned on). Reinstalling my app doesn't fix the issue. Out of the 3 taxi apps that I have on my phone, 2 of them can pinpoint my location. (Most likely they

Android: best method to calculate distance between two locations

六月ゝ 毕业季﹏ 提交于 2019-12-05 12:17:10
i researched a little in this topic, but there are many opinions that don't exactly give a clear image. My problem is this: I'm developing a gps-based app for Android, in wich i want to know distance between my current location specified by Androids LocationManager, and other location in real time. I tried Haversine formula, a Law of Cosines formula, then I discovered, that Android SDK gives me a simple function Location.distanceTo(Location) - i'm not sure what method does this function runs on. So, the point is, wich one will be good for me to use, in situations when real distance between

How accurate is the GPS on the iPhone 4?

懵懂的女人 提交于 2019-12-05 11:39:50
quick question. How accurate is the GPS on the iPhone 4? I ask because I'm working on an enterprise project for a company, and part 2 of it will deal with iDevice development where I have to determine the position of the user. I'd like to know if the GPS is accurate enough to sense the user moving within rooms because the user will have to "tag" sections of the room as they move about it. Thanks in advance! P.S. Pressuming that it won't make much of a difference, but the users will actually end up using the iPads, not iPhones, and more than likely the iPad 2 will be out by the time the entire

Programmatically ending an ongoing notification - Android

情到浓时终转凉″ 提交于 2019-12-05 11:34:54
I am developing a GPS-based app and have just started adding in my UX features such as notifications and progress bars but I'm stuck on using an ongoing notification. As it is a GPS app, when user tracking is started, I set up an ongoing notification to show that they are being tracked but how do I stop this notification when they tap "stop tracking" in my app? Do I have to tell the NotifyManager something? I'm basically trying to get the functionality that music players have, as in the "playing" notification appears when the user presses play, but when they pause, that ongoing "playing"

Can I get the accuracy of GPS location in iOS?

左心房为你撑大大i 提交于 2019-12-05 10:17:07
I've seen Android developers get the accuracy of a GPS location. Is there a way that I can get the accuracy of my currenct GPS location in iOS? I am using the code from this answer to get my location: locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.distanceFilter = kCLDistanceFilterNone; locationManager.desiredAccuracy = kCLLocationAccuracyBest; [locationManager startUpdatingLocation]; - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSLog(@

iphone app: Questions on interaction between CLLocationmanager and MKMapView (showing current user location)

我的未来我决定 提交于 2019-12-05 10:00:23
In my iPhone app, I have the following logic: Start CLLocationManger (the user can supply accuracy and distance filters parameters to locationmanager, since best accuracy is not required in my case, 100-300 meters will do fine, and I'd like to save battery on this). After GPS fix is obtained by LocationManager (and only if this fix is obtained), I create and display the map. Both CLLocationManager and MKmapView are part of the same ViewController. To show the current location, I set mapView.showsUserLocation:YES, to display the blue dot. The locationManager I started still keeps working,