How to process data part 2 : android xml parser tutorials
this tutorial is for processing data fetched from rss feeds
Download Source Code from here :
we are social:
In this class we will store title,pubDate,Link, Description,Thaumbnil url etc . So create all string objects of title, link ,Description,Thaumbnil url etc . to create getters and setters press alt insert and select all methodes and insert them.
Now go to ReadRss class and remove log statement from our previous programm. Now for every item we will create new FeedItem . So create New FeedItem under if condition of item and name it as item.
Now under 2nd for loop we will check our node is title node using if condition. if our node is title node, then we will set title of item as textcontent of our current node . we will do same for all the other description , pubDate and link node.
Now we have to store every item in single item. to do this we will use arraylist .
ArrayList class uses a dynamic array for storing the elements.
.Create new Arraylist of feedItems . Name it as feeditems. Now below 2nd for loop add this item into feedItems arryList. Now create Log statements that will print string data stored in items.
enter tag names as shown in tutorial. Now we done with processing of data . hit run on the top .
here my app is running . Open logcat and search for item .
here we get all title,date,description etc. in good format .
this concludes that we successfully Processed data .
In the next tutorial we will take a look at recyclerview. in the mean time like,share , comment and dont forget to subscribe my channel . thank you have a nice day