gps

Get Location Name by passing Latitude and Longitude in android

北慕城南 提交于 2019-12-11 08:25:14
问题 I have written following code for getting location name : UseGpsActivity.java public class UseGpsActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); /* Use the LocationManager class to obtain GPS locations */ boolean gps_is_enabled = false; LocationManager mlocManager = (LocationManager) this .getSystemService(Context.LOCATION_SERVICE); List

GeoCoordinateWatcher location not returning speed. NaN instead

我怕爱的太早我们不能终老 提交于 2019-12-11 07:55:53
问题 I've been experimenting with getting readings from the GPS with my wp7. I'm using very similar code to the sample found here: Getting GPS coordinates on Windows phone 7 I've got 2 textblocks on the page. One showing the speed from Position.Location.Speed and one showing the timestamp from Position.Location.TimeStamp. This is triggered from the watcher_PositionChanged event. I notice the event being triggered every second or so, as the timestamp updates to reflect this. I'm also reading the

LocationManager still cant find last known location after GPS is turned on

送分小仙女□ 提交于 2019-12-11 07:34:50
问题 I'm having a problem with android where even after the user turns their location service on, the LocationManager still can't find the users location. Before I launch the activity that needs to use the user's location I call the following: //Menu Activity LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); if(lm.isProviderEnabled(LocationManager.GPS_PROVIDER){ Intent nearby = new Intent(mActivityContext, NearbyActivity.class); startActivity(nearby); }else{

Gps location listener stop

风流意气都作罢 提交于 2019-12-11 06:39:45
问题 I am using this piece of code to stop gps locating the problem is that sometimes android kills my process starting it again... and the handle becomes invalid...making it impossible to stop the gps...how can i do this ? here is the code: lm.removeUpdates(locationListener); locationListener = null; 回答1: Try- locationManager.removeUpdates(locListener); if (locListener != null) { locListener = null; } if (locationManager != null) { locationManager = null; } And make sure you initialize your

GPS returning 0.0,0.0 as latitude and longitude on device,but working correctly on emulator

為{幸葍}努か 提交于 2019-12-11 06:36:26
问题 I am new to android. I am able to get the GPS co-ordinates from the emulator, but getting 0.0,0.0 as latitude and longitude in my device. here is my code. Sorry its too long.. class GPSTracker.java package com.example.spotter; public class GPSTracker extends Service implements LocationListener { private final Context mContext; // flag for GPS status boolean isGPSEnabled = false; // flag for network status boolean isNetworkEnabled = false; // flag for GPS status boolean canGetLocation = false;

Cannot get current location until connected to the internet - Android GPS

与世无争的帅哥 提交于 2019-12-11 06:35:58
问题 my question title is kind of self explanatory. When I want to get my current location, for the first time(after phone start up), I have to be connected to the internet. After getting the location once, my app no longer needs the internet connection and the update happens just fine. At first I thought there was something missing in my code, but I tried the in-build maps application, and it also couldn't get my location until I enabled data transfer. This seems really strange to me, if I can

How to efficiently calculate distance between GPS points in one dataset and GPS points in another data set using data.table

霸气de小男生 提交于 2019-12-11 06:09:46
问题 I am facing a coding (optimization) problem in R. I have a long data set with GPS coordinates (lon, lat, timestamp) and for every row I need to check whether the location is near a bus stop. I have a .csv file with all the bus stops (in the Netherlands). The GPS coordinates file is millions of entries long, but could be split if necessary. The bus stop dataset is around 5500 entries long. Using the code and tips given on, inter alia, these pages: 1) How to efficiently calculate distance

snap to road for apple maps

我的梦境 提交于 2019-12-11 06:09:23
问题 I have a project which is constrained to working with apple maps, corelocation and apple's mapkit -- 3rd party interfaces aren't allowed. I need to display a map view showing the user's current location (standard blue dot) and simultaneously place a pin on the road nearest the user's current location -- a 'snap to road' which is a best estimate of the user's nearest location. I know how to retrieve the user's current address and use the returned street name and address, but i don't know how

Javascript Redirect with SetTimout Not Working

♀尐吖头ヾ 提交于 2019-12-11 05:46:14
问题 Can't seem to get this javascript redirect to work? Suggestions? Should I maybe do it with a meta refresh and how? // If we have a successful location update function onGeoSuccess(event) { document.getElementById("Latitude").value = event.coords.latitude; document.getElementById("Longitude").value = event.coords.longitude; document.getElementById("location").href = "track.cfm?track=s&Lat=" + event.coords.latitude + "&Long=" + event.coords.longitude; var redirectUrl = "track.cfm?track=s&Lat="

Send current gps coordinates to mySQL database using google maps api

孤者浪人 提交于 2019-12-11 05:42:09
问题 I am trying to build a golf app in jquery where I can send the current gps coordinates to a mySQL database using a button. The problem is that I am new to php and I am trying to find code that i can use. I have built a database: ID int 3 autoincrement LAT float 10 LON float 10 Can someone please help with some html and php code? <!DOCTYPE html> <html> <body> <div data-role="page" id="page1"> <div data-theme="b" data-role="header" data-position="fixed"> <h5> Play 9 holes </h5> </div> </div> <p