July 2018
Intermediate to advanced
266 pages
7h 11m
English
Now we will create the producer. To do so, let's first create a package co.starcarr.rssreader.producer and put the file ArticleProducer.kt inside it:

In that file, we will create an object ArticleProducer and we will move some of the code from the activity there, starting with the list of feeds:
object ArticleProducer { private val feeds = listOf( Feed("npr", "https://www.npr.org/rss/rss.php?id=1001"), Feed("cnn", "http://rss.cnn.com/rss/cnn_topstories.rss"), Feed("fox", "http://feeds.foxnews.com/foxnews/latest?format=xml") )}
We will also ...
Read now
Unlock full access