2

I have used the system services to retrieve the latitude and longitude of the user.

With this data I would like to send it to the NOAA National Weather Service API and retrieve specific weather details.

I understand API's are interfaces for communication but I have never used one and I'm kind of lost. I've explored the NOAA website for this API and make sense of what there API does but I don't know where to begin.

Can someone give me a place to start? I want to understand, not just receive an easy fix. As said I have the latitude and longitude.

Kevin Panko
  • 8,356
  • 19
  • 50
  • 61
user3047494
  • 429
  • 1
  • 6
  • 14

1 Answers1

1

You'll want to look at implementing a SOAP client in your app, which can then call the NOAA service to retrieve weather information. You'll also need to learn how to parse XML in Android(NOAA sends responses in XML format).

EDIT: As far as I know Android does not have a SOAP client/library but there are some third party ones. This one seems to pop up quite a bit so I'd maybe look at using this: http://code.google.com/p/ksoap2-android/

There's some information here on the NOAA website to get you started: http://graphical.weather.gov/xml/#use_it

There is an example of using lat/long values to return weather info from NOAA here: http://graphical.weather.gov/xml/SOAP_server/ndfdXML.htm

This should hopefully get you going in the right direction.

Karl
  • 3,394
  • 2
  • 22
  • 31
  • Thanks for fast response c: Will give a go! – user3047494 Nov 28 '13 at 22:49
  • Okay I checked that out and maybe I've been at this for too long but all I dont see any tutorials on how to use or code it :c – user3047494 Nov 28 '13 at 23:08
  • Try and get the ksoap library into your project so you can import the classes etc first... http://code.google.com/p/ksoap2-android/wiki/HowToUse – Karl Nov 29 '13 at 01:34