I'm pretty new to android development and I was wondering if I could get some input on what to do in my case. I'm trying to make a list of events that are going on at my school using the calendar that's on its website. The problem is, the only way I found to get to the JSON format is through the .rss which looks like this link
I put it into myjson and got this error message and I have no idea what it means:
Parse error on line 1:
My goal is to be able to use JSON to create a list in a ListView on the app I'm making, but so far I'm completely lost as far as what to do. Any help is appreciated!
JSON is entirely different from RSS.
Look into this tutorial here or check out github, there's a ton of libraries that support RSS parsing such as this or this
Related
is that possible in Android to go though whatever link and get main content from that page(f.e.text) or whatever i want to get? If yes, how i can realize that?
There is couple ways to get data from websites.
First and maybe the most popular way is parsing RSS feed from webiste. Java and Android are providing couple parsers and ways to parse xml or in this case RSS Feed. You can take a look in this examples:
https://developer.android.com/samples/BasicSyncAdapter/src/com.example.android.basicsyncadapter/net/FeedParser.html
https://www.tutorialspoint.com/android/android_rss_reader.htm
Second way is getting needed informations from API if it is provided from webiste and offten that API will be in JSON format. For example https://openweathermap.org/ will return JSON file filled with informations of weather which you can pares into your app. Also Android and Java are providing couple ways to get informations from JSON format. You can take a look on this one:
http://www.androidhive.info/2012/01/android-json-parsing-tutorial/
Third you can use support library called Jsoup for parsing HTML from particular webiste/s. You can find examples how to parse HTML on their offical webiste: https://jsoup.org/
Maybe there is more ways certanly you should look up for them.
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.
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.
There are different ways to accomplish this, but one basic method is:
Create an AsyncTask to access the weather data feed without blocking the main thread.
In the doInBackground() method of the AsyncTask, connect to the JSON file via an HttpUrlConnection and get the InputStream.
Create a JsonReader to access the required data from your InputStream.
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.
i am developing an android app which can stream / download media from a web server, the first thing i am about to do is getting media on server to be viewed in a list just like Youtube, my problem is that i am inexperienced with Json i saw other posts here about that topic but didn't get me anywhere.
where can i start for simple json toturials to simulate my problem? and i heard about Android Volley for such things in android? how useful is it and shall i work with or without it for now?
These links may help you to build concept of JSON
You must google rather than asking
in java there is JSONObject, JSONArray, and others to use with it
http://www.json.com/
http://www.w3schools.com/json/
http://www.json.org/
My website contains a couple of job-listings, so for that how will fetch those job-listing contents and make it displayed in the android app, i followed json parsing tutorials but still din get the output, please can anybody help in.
Try following these tutorial. Might help your cause.
http://www.ingeniumblog.net/2012/01/making-a-slick-rss-reader-in-android/
http://inchoo.net/mobile-development/android-development/simple-android-json-parsing-example-with-output-into-listactivity/
I'm hoping this hasn't been repeated before but I've been stuck on this for about an hour now.
I'm using the XMLwise library to parse a remote PList on an Android app. This parsed data returns a Map. The first item in this Map is the data I want, which when logged gives me this when I use getValue() on the Map entry:
[
{
description=Teaching at the University of Kent has been ranked among the best in the UK by the Guardian 2012 University Guide.,
url=http://www.kent.ac.uk/news/homepagestories/university-of-kent-teaching-ranked-among-best-in-uk/2011,
title=University of Kent teaching ranked among best in UK} .....
},
// etc
]
Now I'm fairly new to Android bu that looks like an array of objects to me, from what I know from JSON notation. Java is telling me this is an Object, so I can't seem to parse this or loop through it. I'm wondering if anyone know what the best way to go about parsing this an attaching it to a ListView would be.
As a note, I've tried several different methods of parsing the Plist data and this library is first one that worked so I'm really not interested in other ways to be honest, just hoping to find out how to parse the data I've received.
Thanks very much!
You will need to cast the Object to be an ArrayList<Object> to iterate over it, based on my reading of the source code.