Rss to Json Api Android Studio - android

I'm working on an Android studio project and till now I have successfully added some json feeds in my app.
However , i need to add one rss feed also to my app.
The easiest solution to me is to make an online conversion of the rss feed to json feed so I can parse my data with the previous code.
Google API is going to stop by 15th Dec 16' and yahoo query is down .
What would you suggest?
I'm about 5 hours now , trying to find a solution.
*I tried rss2json.com however after the first time fetching the data , the feed is refreshed after a long , very long time.

You can create your own toJson(xml) method and use XmlPullParser to read and retrieve the data you need to create a new Json object. I'm guessing you want to use your Json parser instead, but at this point you already have the data that you would be using for your application. So, just use an XML parser instead =).

Related

fetch json data from url and update

I'm new here, give me a solution about json please.
I want to fetch json data to my app from url, and also want to update json data regularly without url change.
suppose, i want to show trending products in an activity, after one day i will change some products of that activity by changing data from json. after updating my json, url cant be change, cause doing update whole app regularly for changing url is not a good idea.
so, is this possible to update json data without changing url?
if yes, tell me please where can i store my json so that i can update t regularly.
or if you can provide any other better possible way to do this, please help me.
Thank you.
That's why we use the database
Basically you need a database o structure your data, then you fetch data from the database using PHP which gives you a Json response
Since you are using Android Studio tag here is a good tutorial on how to fetch data from database using PHP , Json response tutorial
First you gonna start with LocalHost , consider using Xampp , Then use web hosting
You create your database using PhpMyAdmin in LocalHost/phpMyAdmin and you read the data using PHP which return it in Json Format
Then migrate to Web Hosting , in PhpMyAdmin you can export your Database from your LocalHost and Import it in your WebHost/PhpMyAdmin , and you upload your Php files also

Best Practices for fetching json from server for android app

I have an Android app with 1 activity and 3 fragment opened in tablayout.
When a user open the app, the mainActivity fetch a json file from the server to check if the app version still in use and the first fragment fetch also a separate json file to feed the views. Every fragement fetch a separate json file to feed the there views with data.
The problem that I have is, that when the app has more than 100 active user, the json file did not get loaded and the okhttp get a timeOutException when trying to fetch the json file from the server. Basically when a user open the app, 4 json files will be fetched from the server, so I think the server has problem responding to all the requests.
So my question, what is the best practice to resolve such a performance problem, beside upgrading the server itself.
Thank you in advance

eclipse android development, implementing json list

I'm working on an eclipse android project, it's a news app..
The objective is to display the list of news which I must import from an online JSON file and display that list in the activity
let's say I want to display the last 3 news..
and take this as an example : " http://www.tripoliscope.com/api/get_date_posts/?order=DESC&date=2014-07-08&count=3 "
How can I get some data from that JSON and display it in a list?
I've been searching for 3 days and no answer found.
Here we have some examples
Please go through this links
http://www.androidhive.info/2012/01/android-json-parsing-tutorial/
http://mrbool.com/how-to-use-json-to-parse-data-into-android-application/28944
Go Through This Links
First Read About JSON
JSON
JsonReader
Go Through This Tutorial...
Android JSON Parsing Tutorial
Android JSON Parser Tutorial
Parse JSON Data - Android Example
This May Help You..
jsoneditoronline.org/ to parse the json file online.It will show u how the json is encoded.Using that you can easily parse your data.Because then you will get a idea where u need to use JsonObject and JsonArray etc.
You must follow Google Aquery json
https://code.google.com/p/android-query/
http://android.programmerguru.com/android-json-parsing-tutorial-using-aquery/

how do i get the website in json format?

i need to get a website (any website ) in json format to use it with android and json parser to get data and if possible that the website include images to be able to download data and images using json parser.
i have been searching about 2 days without any success, its my first time that i use json so i do know where to search and how to search.
what i need is a website to make a test on it that will be available in json format
anyone can help me ???
i will appreciate that.
Use http://www.jsontest.com/ to get JSON from that website.
Read there and for example if you call http://ip.jsontest.com/ you will get a JSON response as {"ip": "203.92.62.242"} then you can parse them in your android application.
For future readers :
Facebook programmers provide the json format for each request.
All you have to do is :
If the facebook page url is : http://www.facebook.com/youtube
To get json format of page, request this : http://graph.facebook.com/youtube
I suggest to read that :
Usually standard web service today provide data in at least two format: json and xml for each endpoint (url), you just add .xml or .json extension to the requested url.
But most of the time you don't have to do that, common web services today always provide json data because it's defined in RESTFul rules. If they dont, you can't get the json. The case is same for you, just ask the developer for API docs.

How to parse TFL api

I am currently working on TFL based projects. And i want to parse the json file which is available in this link : http://countdown.api.tfl.gov.uk/interfaces/ura/instant_V1
So please help me out
This API is not standard JSON as written in the TFL API documentation. It us actually best parsed as CSV but watch out because I have found out that some responses are inconsistent where the first line might have 6 strings while the second might have 5 with the missing field not identified as an empty string but simply omitted. This way parsing with a CSV parser will lead to errors since you might never know what is omitted.
I have also searched for the solution and the best I could find was another API that gives standard JSON but only returns bus stop countdown via a stopCode request.
Use This Link To Access It.
http://countdown.tfl.gov.uk/stopBoard/75288
Im suprised as to why TFL uses this api for their own apps but not implement the public api to return good JSon like this one.
This API is not standard JSON as written in the TFL API documentation.so after get the content you may change that format. Use this link http://jsonlint.com/ it will validate your json format. so you can easily understand json format error
After get the content do this
JSONArray jArray = new JSONArray("["+ result.replaceAll("]", "],").toString() + "]")
now you get proper json array skip jArray 0th position this is - URA Version array.
It is not a single full JSON object, as per the TFL documentation. You treat each line as a separate JSON object. This way if/when you move to the streaming mode, you can continue to receive objects and interpreting them as they get streamed to you. Also you use the first element in the JSON array to determine how to process that particular line, or in some cases if you need to refresh the base data.

Categories

Resources