I have contacted Open Weather Map support team last week and their forum is dead. Hopefully get some help on here.
I am currently building a weather app for android.
when I send the lat and long for Birmingham UK
which are
lat 52.4447615﹕
lon -1.9292798
it returns Vietnam as the country with a completely different lat lang? I know open weather map is very popular so I must be constructing the url wrong or
something.
http://api.openweathermap.org/data/2.5/weather?q=lat=52.4447462&lon=-1.9292798&units=metric
would really appreciate any help. Thanks,
Matt
It seems the problem is the units argument. Just get rid of it and it works:
http://api.openweathermap.org/data/2.5/weather?lat=52.4447615&lon=-1.9292798
Please note I have not read through the API documentation, just started from their overview page here:
http://openweathermap.org/current.
Try this : [openweathermap.org]1
You can also use Geocoder to get city name from co-ordinates.
Related
I need to get the user location in android but i get the wrong location, I am in London and the location i see in the emulator is US. I created an API key and followed the steps from the following link https://developers.google.com/maps/documentation/android-sdk/start#the_maps_activity_java_file
but i still have the same problem, the wrong latitude and longitude. Can anyone help on this please?
Thanks!
In emulator change lat and lan. Inside location
Hello my fellow coders,
I am trying to retrieve GeoCoordinates from an Android Google Maps SEND Intent (as dispatched when selecting to share a selected location) and even after searching around and trying various approaches for hours now I can't seem to get anywhere. However, all I seem to get from the Intent seems to be a text/plain content like this:
Franziskaner Wirtshaus & Biergarten - Trudering-Riem, München
https://some/shortened/maps/link
I tried (amongst others) several approaches from:
Get GeoCodes from Android Google Maps App (Not applicable since it opens a new activity)
How can I find the latitude and longitude from address? (Geocoder and Geocoding REST API from Google - no suitable results)
None of the above solutions yields any usable results.
Is there a reliable way to get GPS coordinates from something a user selected in Google Maps on Android at all?
Thanks in advance for your help,
Alex
I don't know if this app helps you. you can copy coordinates to clipboard or open it with other third party maps
cheers
I am working on the developement of an android app. I need to locate the user without displaying the map (only the name of his location ei New york, USA)
I work using Eclipse SDK.
Is there a way to do it?
Thanks :)
Ps: I am new to android
Android API Maps
In the API documentation it shows you step by step how to get started on this
type of application.
How to get started
One thing you have to remember is that the user must enable
the GPS to get current location
Since you explained in comments that you already know how to get the Location, and thus the latitude and longitude, you can resolve it to an address using Android's GeoCoder class, with its getFromLocation(double,double,int) method.
I'm using getThoroughwayfare() to get street names but when on a highway / interstate the method returns null. I couldn't find another method that could detect interstates. Has anyone been able to successfully detected interstates?
Thanks
Ok, Its quite old question, but i think i answer for somebody else.
I too need to get information whether i was on interstate or not and Geocoder was of no help.
So i came across Google geocode api which gives plenty of information.
e.g
LatLng: 39.249121,-122.182131
And Url would be:
https://maps.googleapis.com/maps/api/geocode/json?latlng=39.249121,-122.182131&sensor=false
sensor is true in case you sending from mobile and false if using browser.
Now you can open the link and check the detailed reply for yourself, in those json objects, you will get a type = route and you will get I-5 as the short_name of road you are on.
I'm building a mobile-version of a website, trying to have one-click link to launch Google Maps with driving directions to the business, from the user's current location. I have it working fine for the iPhone, but when testing on Android, it views 'Current%20Location' and tries to find a business called 'Current Location'. Here is my current code:
Get Directions
I need a universal string to search from the current location, and can't find a definitive answer anywhere online.
Thanks in advance for any help!
I am doing the same thing and now have it working on Android. I don't have an iPhone so I have no way of testing on that. You should leave the saddr parameter blank in the URL, and Google Maps will then prefill it with the user's current location. Also, use + signs instead of spaces in the destination address. Here's the corrected URL:
http://maps.google.com/maps?saddr=&daddr=123+Street+Rd,Cityville,MD,21098
Use the google gps api to get the currentlocation and pass it to maps. Even better I think there's an action to open the built-in maps application asking it to route from current location to your address.
This article on location services should help http://developer.android.com/guide/topics/location/index.html
If you're trying to do it fully through the web, I think the user has to enable location services on the google webpage for it to work.
Also, check out this javascript library that provides a platform neutral api for gps services on most devices http://code.google.com/p/geo-location-javascript/
Google Maps with directions from current location
https://maps.google.com/maps?saddr=&daddr=35.658157,139.697174&sensor=TRUE
https://maps.google.com/maps?saddr=&daddr= PLUS
"location's_latitude" PLUS
"," PLUS
"location's_longitude" PLUS
"&sensor=TRUE" // for getting your current location
Probably the most accurate way using lat and long
<span class="addressAt">
<a href="http://maps.google.com/maps?f=d&hl=en®ion=US&doflg=ptm&geocode=&saddr=&daddr=41.75553,-88.322048" target="_blank">213 S River St
Aurora, IL</a>
</span>
This is the only way to get an accurate "my location" on the google maps mobile site. Replace the coordinates(41.75553,-88.322048) with your locations coords. All other ways just wrote in my location as the start address without actually getting the real time location.