gps

How can i enable and disable GPS programatically

妖精的绣舞 提交于 2019-12-06 11:50:02
问题 I am developing an application wherein I want to enable GPS, when I start my activity and I want to disable GPS when I exit my application. Can I do it through my program.. Any help would be appreciated. 回答1: Here is the code... private void turnGPSOn(){ String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if(!provider.contains("gps")){ final Intent poke = new Intent(); poke.setClassName("com.android.settings","com.android.settings

Codename one GPS provider and current location

风流意气都作罢 提交于 2019-12-06 11:39:51
问题 I am working on an iOS app with codename one. I want to get the current location and send it by SMS. I got this code from Java Android Studio, I don't know how to get the current location and also check if GPS is turned on. I tried below, but without success (I'm not sure how they start the GPS and get the location) LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE); boolean enabledGPS = service.isProviderEnabled(LocationManager.GPS_PROVIDER); if (!enabledGPS) { /

GPS position correction

你离开我真会死。 提交于 2019-12-06 11:29:36
问题 I wrote simple NMEA parser and I'm reading latitude and longitude from GPS. Values readed by my parser are very scattered comparing to some GPS commercial library I'm using. Values readed from this library are very smooth. What algorithms I should use to correct readed position from gps? 回答1: One option would be a Kalman filter 回答2: GPS Signals read from a GPS receivers are today only scattered, if the receiver is standing still, or moving very slowly. A simple and very effective approach is

Fused location API gives highly inaccurate location after closing google maps

谁说胖子不能爱 提交于 2019-12-06 11:22:22
Our application uses Google Fused location API to receive location updates every 3 minutes. The location request settings are as follows – Interval – 3min Fastest interval – 1 min Priority - PRIORITY_BALANCED_POWER_ACCURACY In a normal running scenario, the location updates are received properly and the location accuracy is pretty good (around 20-25 m). When the Maps application is opened, it received GPS location, and therefore our application also starts receiving location updates, which are basically from the GPS transceiver (I know this as the subsequent location updates have a speed and

How to translate a given coordinate into a bounding box of “diameter” x?

て烟熏妆下的殇ゞ 提交于 2019-12-06 11:17:19
For example, I have a latitude and longitude in decimal format (as opposed to Degrees-Hours-Minutes like lat=44.1° 9.5' 30''). To search for nearby objects, I must specify the search "radius" as a rectangle with four values: north = 44.1; south = -9.9; east = -22.4; west = 55.2; Is there a formula or rule of thumb how to convert decimal lat/long values into a rectangular bounding box, such that the given latitude/longitude is in the center of that box? Must I fiddle around myself with a WGS84 ellipsoid algorithm or are there open solutions to the problem? I had exactly this problem and the

Check if user device's GPS is on

此生再无相见时 提交于 2019-12-06 11:05:43
问题 I am developing an app using jQuery Mobile with PHP. I am not using Phonegap or other frameworks. I need to find user's geolocation . If user device's GPS is off, then I cant get a location. now I need to find user device's GPS is on or off. this is what i using now. function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } } function showPosition(position) { var lat

LocationRequest in Google Play Services isn't updating for interval set as less than 1 second.

拜拜、爱过 提交于 2019-12-06 11:00:30
问题 I'm developing an android app in which I need to show location updates with some 30-40 updates per second. I'm using the Location APIs of Google Play Services, introduced in Google I/O 2013. It uses a fused location provider (making use of accelerometers and other sensors along with GPS) for more accurate & efficient location tracking. Here's my code: protected void startLocationTracking() { if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(this)) { mLocationClient = new LocationClient

How do I calculate distance between GPS co-ordinates on a processor with poor floating point support?

为君一笑 提交于 2019-12-06 10:18:38
问题 I need to calculate the distance between GPS co-ordinates to calculate distance traveled. I've tried both the Haversine and Vincenty algorithms, which work fine on my desktop PC, but when I port the code to the dsPIC, they return 0 for points that are close (within several meters) due to a lack of floating point precision and poor implementations of sin and cos. For my use case, my points will be no more than 10 meters apart and will all fall within 10km of each other. I've tried the

different behaviour for current location latitude and longitude in iOS7 to IOS8

落爺英雄遲暮 提交于 2019-12-06 10:10:09
Using xamarin for current location currentLocation example I used the above Link for getting current location latitude and longitude. In IOS 7 before upgrade to IOS 8 Its shows my current location latitude and longitude on both simulator and device.(Its looks strange for me in simulator for getting current location latitude and longitude). After upgrade to iOS 8 and run same code it give In simulator:(Turn on wifi no sim card location service App always.) Result: latitude = 37.785834. longitude = -122.406517. On Device IPhone5c (Turn on wifi no sim card location service App always.) Result:

Android - Getting Network GPS location within a short time frame (10 seconds max)

耗尽温柔 提交于 2019-12-06 09:50:00
I'm trying to set up a quick and dirty GPS lookup via LocationManager which fetches a network location (within 500 meters) every half second for ten seconds. In other words, I'm just trying to find the correct coarse Criteria settings and the correct logic to stop checking after 10 seconds of no better locations within my Handler thread. I'm thinking my main loop should look something like this: /** * Iteration step time. */ private static final int ITERATION_TIMEOUT_STEP = 500; //half-sec intervals public void run(){ boolean stop = false; counts++; if(DEBUG){ Log.d(TAG, "counts=" + counts); }