first i would love to thank you for help me,i am develop the android application that contain 3 activities one of them is map.i am using google maps
what i want : 1- when the user open the activity (map) it shows the user her location not the coordinate 2- the user also can be able to positing(pining) any place by using pin and my app must store the coordinates for this pin in variable so i can use it later. PlEASE HELP ME
You should first obtain the user latitude and longitude. Then use the GeoCoder to obtain the address.
You have the complete code here , https://stackoverflow.com/a/3145655/563306
Related
I am trying to implement an android app where users can enter their city , and I need to add a marker to that city user input.
So far I was stumbling upon google auto-complete API , then I got autocomplete part working . But now I need to place a marker and for that and I need geo-code of the city that user entered , but as I understand google API for auto-complete only provide address or city , no geo-codinates.
Since I am fairly new to android development , can someone assist me with this situation and let me know whether there is a method of getting geo-codinates from single auto-complete API call ?
"you can convert an address to the corresponding geographic coordinates. This process is called geocoding"
Android come with some tools for geo data manipulation as the Geocoder class, I don't know if it is the most efficient solution, but you can try it.
When you obtain the address description with autocomplete api you can call a service to do the geocoding and get the geographic data, then you can show it in your map.
You should read this!
This is an example
I got confused on how to solve this problem.
I need to develop and android application titled 'Local Food Finder'.
in my application, user search a food that they want to eat
my application will give the result by listing all the restaurant that provide the related food.
user can choose the restaurant and user can go to the restaurant by using gps.
I have collect all the restaurant location data (longitude & latitude)
After make some research and study, I think I need to use GPS code.
For now, I already have the location data (latitude and longitude) for every restaurant.
But, I don't know where to place/store the data. Do I need to place it in database? So my application can retrieve the restaurant's location from the database.
And then after that, how can user go to the location using this longitude and latitude? What code I have to use..? I know I have to use Java code but I didn't find the example code...
Someone please help me. I am a android beginner. I really don't know how to settle this.
I would recommend storing the data in https://www.parse.com, because they support geospatial queries. 'give me all reastaurants matching food x near (lat,lon)'.
To get the device position you could use https://github.com/mcharmas/Android-ReactiveLocation. Is the simplest code that I found so far to do so.
I am trying to displaying a user current location on a map using phoneGaps getCurrentPosition function but I don't just want the users latitude and longitude I want their actual location example state they are current in, street name, country name ect. If anyone could point me in the correct direction I would greatly appropriate it (ebooks, weblinkes, blog post, code snippets anything). Thanks
You're going to need to reverse geocode the lat/lng into an address. Google has an API for that: https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding
I was wondering how I can channel or simulate Google Maps just in the sense of a user types in a location in text, such as a restaurant name and a city name. Then Google suggests 5 or so places they have indexed, and presumably they know the GPS coordinates because Google then puts them on a map. I want to be able to use that feature- not the map, just getting the location.
My goal is for a user to type in a query, 5 options or so to be shown, and if they user chooses one of them, then the GPS coordinates, or a location object, is saved representing that place.
Ideally I could just send the query to Google and steal the results back to my app. Obviously building my own database of locations and an algorithm to suggest them is out of the question.
Thanks for the help and advice in advanced!
Note 1: To clarify, this does NOT involve the current position of the user/device.
Note 2: I looked at the Google Maps add-on API, but it looks like that is for a visual map, not the querying a location part. You are already supposed to know your location, and it will map it.
Use geocoder.getFromLocationName, you get back a list of Address objects, in those objects you will find all the information you need about the location.
To test this on the simulator you need an image with the Google APIs included. In a device should be fine if you have the market installed.
In my app I ask user to enter his location(text) and call Google web service to find out geocodes and then display on map.
Now I also want the user to fine tune his location by moving the marker on the map.
How can this be done?
Rgds,
Sapan
Please take a look at this source http://bazaar.launchpad.net/~financisto-dev/financisto/trunk/view/head:/src/ru/orangesoftware/financisto/activity/LocationActivity.java at LocationOverlay inner class in particular