gps

Getting Android Location and return “unknown” or null when providers are unavailable

我们两清 提交于 2019-12-07 07:43:29
I'm using this script by Fedor but I want a little difference: When both GPS and Network Provider is unavailable, I want to app to return null or "unknown" string. I modified the script, but when I run, it force closes, the logcat says: I have the following codes: MyLocation.java package com.example.GetALocation2; import java.util.Timer; import java.util.TimerTask; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; public class MyLocation { Timer timer1; LocationManager

iPhone running periodical process in the background - battery optimized way

独自空忆成欢 提交于 2019-12-07 07:00:56
问题 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

Can I get the accuracy of GPS location in iOS?

核能气质少年 提交于 2019-12-07 06:54:08
问题 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

Programmatically ending an ongoing notification - Android

大兔子大兔子 提交于 2019-12-07 06:43:14
问题 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

HOW TO: Read out GPS attached via USB (VB.NET) [closed]

隐身守侯 提交于 2019-12-07 05:36:26
Closed . This question needs details or clarity . It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post . Closed 4 years ago . How can i read out GPS-Data from a GPS-USB-Device via VB.NET? it took me a while to gather all information and code-snippets to read latitude/longitude coordinates from a GPS attached via USB. so here is the resulting class clsGpsLocation. it includes a function that checks com ports to determin wether a GPS is connected (FindComPort) and a sub that returns latitude/longitude (GetPos). a public

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

浪尽此生 提交于 2019-12-07 05:25:19
问题 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

Android: best method to calculate distance between two locations

我们两清 提交于 2019-12-07 05:18:13
问题 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

How to convert GPS degree to decimal and vice-versa in jquery or javascript and PHP?

℡╲_俬逩灬. 提交于 2019-12-07 04:58:24
问题 does someone know how to convert GPS degree to decimal values or vice versa? I have to develop a way where users can insert an address and get the GPS values (both degree and/or decimal), but the main thing i need to know is how to convert the values, cause users can also insert GPS values (degree or decimal). Because i need to get the map from google maps this needs decimal. I've tryed some codes but i get big numbers...like this one: function ConvertDMSToDD(days, minutes, seconds, direction

Control iOS gps input

一世执手 提交于 2019-12-07 03:59:12
问题 I have a problem with iPhone GPS ; i'm trying to record a track that is not on a street , but each time I pass near a street ( look at enclosed image ) it seems to me that the gps output is corrected with maps data ; Is there a way to disable this beahviour ? I need the precise point in my app 回答1: To avoid the "snap to road" feature, set the activityType to CLActivityTypeOtherNavigation . All other values (Other, Fitness, AutoNav) for activityType will snap to the nearest road. This was the

How accurate is CoreLocation's accuracy measurement

痴心易碎 提交于 2019-12-07 03:33:47
问题 I have been testing the accuracy of various aspects of CoreLocation and have been surprised to find the accuracy value supplied on new and old locations passed to the CLLocationMangerDelegate method: (void)locationManager:didUpdateToLocation:fromLocation is wildly inaccurate itself. Walking certain stretches of pavement(along a stretch of road with buildings along one side) I have found that whilst CLLocationManager claims the CLLocations it is supplying have a horizontal accuracy of 5 meters