0

Am trying for long Days.But still i am trouble to get the latitude and longtitude value.My Goal is to get the latitude and longtitude value for 15mts once.am searching and trying follow links http://developer.android.com/reference/android/location/LocationManager.html

http://about-android.blogspot.com/2010/04/find-current-location-in-android-gps.html

http://www.firstdroid.com/2010/04/29/android-development-using-gps-to-get-current-location-2/

while adding this line i got error like this Is it possible to get the latitude and longtitude value for 15mts once?

Error update

01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011): Error parsing response: 
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011): org.json.JSONException: Value <HTML><HEAD> of type java.lang.String cannot be converted to JSONArray
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at org.json.JSON.typeMismatch(JSON.java:107)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at org.json.JSONArray.<init>(JSONArray.java:91)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at org.json.JSONArray.<init>(JSONArray.java:103)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at com.google.android.googlequicksearchbox.google.GenieClient.sendGenieSearchRequest(GenieClient.java:509)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at com.google.android.googlequicksearchbox.google.GenieClient.executeGenieRequest(GenieClient.java:476)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at com.google.android.googlequicksearchbox.google.GenieClient.query(GenieClient.java:205)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at com.google.android.googlequicksearchbox.google.GenieClient.queryInternal(GenieClient.java:165)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at com.android.quicksearchbox.google.GoogleSource.getSuggestions(GoogleSource.java:120)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at com.android.quicksearchbox.google.GoogleSource.getSuggestions(GoogleSource.java:35)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at com.android.quicksearchbox.QueryTask.run(QueryTask.java:62)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at java.lang.Thread.run(Thread.java:1096)
01-08 18:05:05.797: WARN/QSB.SuggestionProvider(2011):     at com.android.quicksearchbox.util.PriorityThreadFactory$1.run(PriorityThreadFactory.java:45)
Community
  • 1
  • 1
Mercy
  • 1,862
  • 9
  • 39
  • 75
  • I think with the use of LocationManager you can get latitue and longitude. But still if you are not able to get it then check that you have GPS is on in the device. Second things is with the use of Location you can get distance between two latitude and longitude. Please check this link http://developer.android.com/reference/android/location/Location.html – Silvans Solanki Jan 11 '12 at 13:40

1 Answers1

0

Please check this

locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,15, locationListener); 
musefan
  • 47,875
  • 21
  • 135
  • 185
Nitesh Khosla
  • 875
  • 8
  • 20