gps

Getting Location Updates frequently in Service

北城余情 提交于 2019-12-12 01:03:48
问题 I am developing an android app, Getting location updates frequently by service. My code is this MainActivity.java import android.app.Activity; import android.content.Intent; import android.location.LocationManager; import android.os.Bundle; import android.provider.Settings; import android.view.Menu; import android.view.View; import android.widget.CompoundButton; import android.widget.Switch; public class MainActivity extends Activity implements CompoundButton.OnCheckedChangeListener{

Wait until GPS location is retrived for ListActivity

*爱你&永不变心* 提交于 2019-12-12 00:26:47
问题 I am working on an Android project in which I am using GPS data for showing nearby Restaurants. On the server side, I have implemented the Haversine formula to get nearby Restaurants depending upon the longitude and latitude retrieved. But, I am having a problem as to how should I tell my ListActivity class to wait until a non-zero GPS location is retrieved. I checked similar questions, but they didn't provide any help for ListActivity. Any help would be nice. Thanks a lot. ListRestaurants

Finding a gps location at a certain time given two points?

霸气de小男生 提交于 2019-12-11 23:35:53
问题 If I have two known locations and a known speed, how can I calculate the current position at distance d (in km)? For example, given: Two gps locations in ES4236: 37.783333, -122.416667 # San Francisco 32.715, -117.1625 # San Diego Traveling at 1km/min in a straight line (ignoring altitude) How can I find the gps coordinate at a certain distance? A similar SO question uses VincentyDistance in geopy to calculate the next point based on bearing and distance. I guess, more specifically: How can I

How can I wait for Async(geocodeService.GeocodeAsync) service/method to complete?

一世执手 提交于 2019-12-11 23:20:37
问题 Am using the GeocodeService to get the lattitude and longitude of two places( from, to) am getting latitude and longitude perfectly but my problem is the message is displaying before async call ( geocodeService.GeocodeAsync ) how can i wait to complete Async call ( geocodeService_GeocodeCompleted ) ?? my code is private void point_Click(object sender, RoutedEventArgs e) { getCoordinates(fromText.Text, 1);// this is calling after bellow message box :( getCoordinates(toText.Text, 2); MessageBox

Application force close in one cell phone when trying to get location from GPS, but in the other one it works

好久不见. 提交于 2019-12-11 22:15:27
问题 Im trying to get an adress trough the gps, converting the coordinates to my location. I am using this code: latitude1 = (location.getLatitude()); longitude2= (location.getLongitude()); JSONObject ret = getLocationInfo(); JSONObject location2; String location_string; try { location2 = ret.getJSONArray("results").getJSONObject(0); location_string = location2.getString("formatted_address"); Log.d("test", "formattted address:" + location_string); StringRua = (" " + location_string); } catch

Track other devices with GPS, android? [closed]

馋奶兔 提交于 2019-12-11 21:23:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am working on an application which will be installed on around 50 devices. I will be getting the location of all those 50 users in every 5 minutes. I have a small concept tell me if it's possible or not. And if possible how do i implement that? So it goes like this we have the location co-ordinates i.e.

I can't get location on Android real phone

荒凉一梦 提交于 2019-12-11 20:40:46
问题 public class LocationService extends Service { private Handler mHandler = new Handler(); private Timer mTimer = null; private int mCount = 0; public static final long NOTIFY_INTERVAL = 10 * 1000; @Override public IBinder onBind(Intent intent) { return null; } @Override public void onCreate() { // cancel if already existed if (mTimer != null) { mTimer.cancel(); } else { // recreate new mTimer = new Timer(); } // schedule task mTimer.scheduleAtFixedRate(new TimeDisplayTimerTask(), 0, NOTIFY

GPS Info without internet in android

萝らか妹 提交于 2019-12-11 20:05:29
问题 I want to save GPS info into database when the internet connection is off in android. that information by which the phone detect GPS location. is this possible? please advice me.. 回答1: GPS works without Internet. Internet is only required for A-GPS (to get the position faster when GPS does not know where you are since it's way faster if GPS knows a rough area of your location). On the other hand there is afik no way to provide that rough position to your GPS since that is not a part of

Google Maps Shading - iOS

点点圈 提交于 2019-12-11 19:47:36
问题 Let's say I have a list of cities (from around the world). Perhaps "Dallas" shows up 4 times whereas another city might show up 2 times, or even just once. I'd like to have a map of the globe in my iPhone application where cities are shaded according to how often they appear in the list such that the darker the city is, the more times it shows up on the list of cities. Can I use google maps for this? What would achieving something like this consist of? I have experience with iOS and I've

Turn on the GPS on automatically like OLA cabs app

谁说胖子不能爱 提交于 2019-12-11 19:43:37
问题 I am trying to turn on the gps automatically. But I can not find the solution for this. Now I am using like navigate to the settings page to turn on the GPS. In OLA cabs app gps is automatically on. I want to turn on the GPS location automatically like OLA cabs. I am using following code for switch on the GPS. public void MessageNoGps(final Activity mActivity) { final AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); builder.setMessage(mActivity.getString(R.string.gps_enable))