0

I'm bit of a basic programmer so forgive me if this sounds super basic and easy. I have been tasked to create a 3 day weather app by only using the BBC RSS feed, shown in the link here (this is a manchester RSS feed, i can probably add more feeds if i can).

http://open.live.bbc.co.uk/weather/feeds/en/2643123/3dayforecast.rss

i have only seen ones with yahoo, i don't know if it is similar to the BBC RSS feed. Also many of them contain something called 'JSON' which i have no idea if it can help me or hurts me if i follow the tutorials from that.

Thanks if anyone can help me.

2 Answers2

0

I'm not sure what your actual question is, but JSON is a standard format for transferring objects between programs. It is explained well in this stack overflow post. A good library to handle JSON in Java is org.json. In the future, try to come up with a specific issue to ask a question about, not a general problem.

Community
  • 1
  • 1
Rich Sala
  • 93
  • 8
  • sorry about wording it wrong, i was really tired when writing this up. Basically i mainly wanted to ask if there is a tutorial of making a BBC weather app and if not, is it simple enough to making it using JSON despite the information being from a RSS feed. – martyboyx5 Jul 21 '16 at 13:00
0

There are different ways to accomplish this, but one basic method is:

  1. Create an AsyncTask to access the weather data feed without blocking the main thread.
  2. In the doInBackground() method of the AsyncTask, connect to the JSON file via an HttpUrlConnection and get the InputStream.
  3. Create a JsonReader to access the required data from your InputStream.
  4. In the onPostExecute() method of the AsyncTask, update your UI with the data.

If you change the extension of your URL to '.json', you will be able to access the JSON version of this file.

You could also parse the XML (.rss extension) version of the file.

Ultimately these are fundamental concepts in Android development so you will have to do some more research.

alstr
  • 1,358
  • 18
  • 34