Author
how to get a longitude & latitude from a given address
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 690
I need to get a longitude & latitude from a given address ?
can any one tell me ?
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
There are web services you can contact for this sort of information. The one we use where I work belongs to Google: The Google Geocoding API . The word for what you want to do is "geocoding".
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted Sep 30, 2011 11:00:00
0
That's what the android.location.Geocoder class does.
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 690
this is my java class
this is my main xml
this is the exception i am getting
}
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted Sep 30, 2011 11:52:26
0
So Android can't find the com.draw.FindLocation class - is it part of the .apk file? It's not part of Android itself.
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 690
I create a new project
this is my java class
this is main.xml
this is geocodexml file
this is th\e error
Michal Krawczyk
Greenhorn
Joined: Oct 15, 2011
Posts: 3
Here is working code:
SearchByAddress.java
view.xml
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 690
I try this with your example .then it gives this error.please see attachment.
error.jpg
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8566
Instead of posting attachments, it would help if you copy paste the stack trace
[Donate a pint, save a life! ] [How to ask questions ] [Onff-turn it on! ]
Michal Krawczyk
Greenhorn
Joined: Oct 15, 2011
Posts: 3
I run my code which I paste above and everything is ok.
Execution result is on the image placed here
Your console says there is a problem with your device. You tried run application once or maybe more?
You can try choose your Android API version 1.6, I know that can help sometimes.
subject: how to get a longitude & latitude from a given address