aspose file tools
The moose likes Android and the fly likes how to get a longitude & latitude from a given address Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "how to get a longitude & latitude from a given address" Watch "how to get a longitude & latitude from a given address" New topic
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
    
    2

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
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
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.


[Thumbnail for 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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to get a longitude & latitude from a given address
 
Similar Threads
How to get "closest to" values in a query?
Displaying Location map on JFrame
Given a zip code return latitude and longitude
Having issues reRendering a map when a rich:tree node is clicked on(SOLVED)
Help In Creating a Mobile Tracker