Title : #4 How to process data part 2 : android xml parser tutorials
link : #4 How to process data part 2 : android xml parser tutorials
#4 How to process data part 2 : android xml parser tutorials
In this class we will store title,pubDate,Link,Description,Thaumbnil url etc.
So create all string objects of title, link ,Description,Thaumbnilurl etc.
to create getters and setters press alt insert and select all methodes and insertthem.
Now go to ReadRss class and remove log statementfrom our previous programm.
Now for every item we will create new FeedItem.
So createNew 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 nodeis title node, then we will set title of item as textcontent of our current node.
we willdo 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 addthis item into feedItems arryList.
Now create Log statements that will print string datastored in items.
enter tag names as shown in tutorial.
Nowwe 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.
Thus Article #4 How to process data part 2 : android xml parser tutorials
You now read the article #4 How to process data part 2 : android xml parser tutorials the link address https://svedda79.blogspot.com/2016/03/4-how-to-process-data-part-2-android.html
0 Response to "#4 How to process data part 2 : android xml parser tutorials"
Post a Comment