Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some useful links for get own current GPS coordinates.</p> <p><a href="http://www.firstdroid.com/2010/04/29/android-development-using-gps-to-get-current-location-2/" rel="nofollow">http://www.firstdroid.com/2010/04/29/android-development-using-gps-to-get-current-location-2/</a></p> <p><a href="http://www.oudmaijer.com/2010/04/15/android-retrieving-your-current-location/" rel="nofollow">http://www.oudmaijer.com/2010/04/15/android-retrieving-your-current-location/</a></p> <p><a href="http://developer.android.com/guide/topics/location/obtaining-user-location.html" rel="nofollow">http://developer.android.com/guide/topics/location/obtaining-user-location.html</a></p> <p><a href="http://about-android.blogspot.in/2010/04/find-current-location-in-android-gps.html" rel="nofollow">http://about-android.blogspot.in/2010/04/find-current-location-in-android-gps.html</a></p> <p><a href="http://www.android10.org/index.php/articleslocationmaps/209-obtaining-user-location" rel="nofollow">http://www.android10.org/index.php/articleslocationmaps/209-obtaining-user-location</a></p> <p><a href="http://www.android10.org/index.php/articleslocationmaps/226-android-location-providers-gps-network-p" rel="nofollow">http://www.android10.org/index.php/articleslocationmaps/226-android-location-providers-gps-network-p</a></p> <p>You can find more easy and clear information about get user's current GPS coordinates. Some of the tutorials are also there. Hope this will help you.</p> <p><strong>EDIT</strong></p> <p>Try this...</p> <pre><code>public class gpsactivity { private static final int gpsMinTime = 6000; private static final int gpsMinDistance = 1; private LocationManager locationManager = null; private LocationListener locationListener = null; private Location location; private String bestProvider; private GPSCallback gpsCallback = null; private GeomagneticField geoField; public gpsactivity() { locationListener = new LocationListener() { public void onProviderDisabled(final String provider) { } public void onProviderEnabled(final String provider) { } public void onLocationChanged(final Location location) { if (location != null &amp;&amp; gpsCallback != null) { // gpsCallback.onGPSUpdate(location); geoField = new GeomagneticField( Double.valueOf(location.getLatitude()).floatValue(), Double.valueOf(location.getLongitude()).floatValue(), Double.valueOf(location.getAltitude()).floatValue(), System.currentTimeMillis() ); } } @Override public void onStatusChanged(String arg0, int arg1, Bundle arg2) { // TODO Auto-generated method stub } }; } public Location getCurrentLocation() { if (locationManager != null &amp;&amp; bestProvider != null &amp;&amp; bestProvider.length() &gt; 0) { location = locationManager.getLastKnownLocation(bestProvider); } return location; } </code></pre> <p>And call this class by</p> <pre><code> gpsManager = new gpsactivity(); location = gpsManager.getCurrentLocation(); if (gpsManager != null) { Longitude = location.getLongitude(); Latitude = location.getLatitude(); if (location != null) { location.setLatitude(Latitude); location.setLongitude(Longitude); } } intLatitude = (int) (Latitude * 1000000); intLongitude = (int) (Longitude * 1000000); </code></pre> <p>Thanks...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload