New Update Version 2.92:

  • Improve drag down to refresh content
  • Enable/disable page navigation function
  • Fix app crash bug
  • Add Google Play Library
  • Add Interstitial Ads

New Update Version 2.4:

  • Change to load content from link by default
  • Add more comment in source code
  • Fix SimpleDateFormatter “Unparseable Date” bug: this bug will cause European users cannot load the rss content;
  • Add AdMob 6.4.1 module to help you monetize your app;
  • Add Google Analytics V2 module to help you trace installation;
  • Fix WebView webpage not available bugs

Show rss content is the last task for Rss Reader Android App. In this android code example, I will create a new Activity class to handle the presentation. Normal Rss feed content is HTML formatted. So I prefer to use WebView to show RSS content instead of TextView. In the following Android WebView example, I will show you how to switch activities programmatically, pass data from one activity to another activity, and show HTML content on WebView.

This is the No.5 Android tutorial about how to create a Rss Reader Android App. Before staring to read this Android tutorial, you’d better to read the following android tutorial first.

In previous Android guide, we already get the Rss feed successfully, and show all the titles in a list. The next task is showing the content of a RSS entity when users click any of titles in the list. So we will set a click listener on ListView. Different from setting click listener on button, we need to call setOnItemClickListener on ListView in this case.

postListView.setOnItemClickListener(onItemClickListener);

Next, we will create an onItemClickListener object which implements the OnItemClickListener interface, to handle the user click event on list items.

	private OnItemClickListener onItemClickListener = new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
				long arg3) {
			// TODO Auto-generated method stub
			PostData data = listData.get(arg2 - 1);
			
			Bundle postInfo = new Bundle();
			postInfo.putString("content", data.postContent);
			
			Intent postviewIntent = new Intent(MainActivity.this, PostViewActivity.class);
			postviewIntent.putExtras(postInfo);
			startActivity(postviewIntent);
		}
	};

In above Android example source code, we set a item clicking event listener on ListView. Inside the listener, we get the corresponding Rss entity basing on which item user clicked. Then, we instantiate a new Activity Intent and pass the data to this Activity by Bundle. Then, we call startActivity to switch to the new Activity. Now let’s see the PostViewActivity class source code example:

package com.jms.rssreader;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class PostViewActivity extends Activity {
	
	private WebView webView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		this.setContentView(R.layout.postview);
		Bundle bundle = this.getIntent().getExtras();
		String postContent = bundle.getString("content");
		
		webView = (WebView)this.findViewById(R.id.webview);
		webView.loadData(postContent, "text/html; charset=utf-8","utf-8");
	}
}

In PostViewActivity class, we get the data from Bundle which is passed through by previous Activity. After we get the Rss content, we call WebView.loadData() to show the Rss on the screen. The following image is a snapshot for showing Rss content on WebView.

Click Rss Feed Entity in ListView
Click Rss Feed Entity in ListView

Try Example Android App

You can download and install this android app by click the following link, or scan the following QR code to download and install on your android phone simply. If you feel it is helpful, please support me by clicking the banner inside the app.

Download and Run Rss Reader App on Your Android Phone
chart

Get Full Source Code under $6.99


You will get whole Android Rss Feed App source code at $6.99. With this source code, you can do everything you want:

  • Load your website rss feed;
  • Monetize the app with your own AdMob publish id;
  • Use the source code in your own project;
  • Publish this app in your android develop account;
Previous PostNext Post

162 Comments

  1. Sorry but your app on nexus 4 not work, it go in but there is only link get more but no title and news

    1. Hi Alex,

      I just want you know that I am update this android app. I think I solve the problem you were facing last time.

      Please try my version 2.2. If there are some problems, please let me know.

      Thank You

  2. Hi, Alex,

    First, do you check if your Nexus 4 can access the internet? Because I checked in my phone, HTC, it can show the admob ads and post.

    If you can only see the “Click to load more…”, it seems to be because it can not access the internet.

    Thanks

  3. Sample looks great! Does it also work with feedburner feeds? Since I’ve tried various other tutorials but they didn’t work with feedburner.

  4. i bought your source code , but im having same problem as marco , i am unable to download it through chrome , i tried after a day and yet not downloading . pls help , i hope this is not something to fool people to pay for nothing.

    1. Hi Ponto,

      Don’t worry. When did you make the purchase? Because I didn’t get any payment these days, can you please send your PayPal account to me on my Contact Us page? I can send the source code to your email address.

      Thanks

  5. I bought your app and have entered this RSS Feed
    “http://www.bild.de/rssfeeds/vw-home-16725562, short = 1, sort = 1 view = rss2.bild.xml”
    First, the data in the listview displayed but when I select an entry crashes the app.
    Can you help me further.
    Second, the ListView does not display images from this rss print.

    1. Hi Boukhsibi,

      I am sorry for late reply. I have tried your Rss Feed Link in my browser, but it doesn’t provide me the valid xml format. I don’t know if you problem is caused by your rss feed data format.

      For the image problem, because Rss Feed Standard doesn’t provide the image information for each entity. So that you have to change the source code basing on your customized rss image.

      For how to load image in ListView, you can access this post: Download Images by AsyncTask in ListView Android Example

  6. I bought the app and I have two questions:
    1 – I have this RSS feed entered “” the data is in listview but displayed
    when I select an item crashes the app.
    2 – The data in the listview were without image despite the rss contains images.

    1. Hi Boukhsibi,

      For the problem 1, can you please provide me one rss feed link so I can test for you. Please contact me.

      For the problem 2, image is not the standard in Rss. so that you need to change the code basing on your own customized rss data.

      Thanks
      James

  7. Hi, i’ve bought the application and I’ve tried to change the defautl url with this : “http://www.trentino5stelle.it/feed/” but doesn’t work. After the download i don’t see nothing in my app display? Why?
    I modify only the MainActivity.java in this line:

    http://www.trentino5stelle.it/feed/

    Thanks,

    Andrea

    1. Dear Andrea,

      It is because of the pagination feature. In the class file MainActivity.java, you can find two functions, startFresh() and startLoadMore(). In this two functions, I append a pagination parameter in the end of feed url.

      I can change it with your own pagination format.

      Best Regards
      James

      1. How can I change it? I’ve tried to comment this part of line:

        into startRefresh():
        new RssDataController().execute(urlString );//+ 1);

        and into startLoadMore():
        new RssDataController().execute(urlString );//+ (++pagnation));

        but nothing changed. What can I do to solve this task?

        Thank you!
        Andrea

        1. Hi Andrea,

          I have run your url in this example, it works actually. Here is a snapshot of my emulator.

          Best Regards
          James

          1. Uhm..it’s a little strange. I’ve tried only on my phone and the code doesn’t work.
            Ok, works. First I’ve delete the admob and I think that i’ve delete too much code. I’ll retry step by step for don’t show the admob.
            Thank you James, your tutorial is great and your assistance really helpful!

            Awesome!

            Andrea

  8. Hi James. I’m sorry, always me.
    I’ve solved the previous bug but a new one is born. I can display all the RSS feed but if I click one of this the app will crash. What cold be?

    Thank you,

    Andrea

    1. Hi Andrea,

      Don’t worry about asking any questions. For this issue, I think you can compare with your website rss feed with my website rss feed. You can find that in you rss feed, there is missing one tag .

      In the example app, please search xpp.getName().equals(“encoded”), and you will find this code is not running because there is no encoded tag in your feed.

      Solution: please search code postInfo.putString(“content”, data.postContent);. This code will send the content to next activity. So you have to change to send your post link to next activity instead.

      Then, in next activity, PostViewActivity, you can find this code webView.loadData(postContent, “text/html; charset=utf-8”, “utf-8”);. Please change it to load your given link instead of postcontent.

      Best Regards
      James

      1. Ok, bug solved! 🙂 I haven’t a content in my feeds. So I’ve to go into the website. What can I do? Where can I modify the code for this task?

        Thanks,

        Andrea

          1. Oh, ok. I’m sorry 🙂

            Thanks for all.

            I’ve another question but I’ll ask you in the right place 🙂

            Andrea

  9. Hi Sir,
    I develop the one project .In that project I have List-view .when I click each row coming the web-view is open how to write code please given any suggestion sir.

  10. I’m completely unsure as to where
    ‘postListView.setOnItemClickListener(onItemClickListener);’ goes.

    is it still in PostViewActivity, and if so, where exactly?

    1. postListView.setOnItemClickListener(onItemClickListener) is a function to handle user’s clicking on a list item. If you click a post in list, it will direct you to a new activity to show post content.

        1. Actually, is the postListView.setOnItemClickListener(onItemClickListener)
          meant to go into the PostItemAdapter.java along with the following code below it?

          1. Ok. It was in Main Activity all along.
            But now, nothing loads, it just brings me to a white screen..

          2. It is, I just have very low experience of Java and Android.
            But trying to view this webpage is an issue.
            I’ve followed this with no errors after debugging, gone through Andreas solutions above, but still it’s only showing a white screen when I press one of the links in the list.

          3. OK. I give you one hint. For the original code, it works properly, right? After you change rss feed source, it doesn’t work for you. So that means your rss content is different from mine. Therefore, you have to pay attention on what’s the different.

            Best Regards
            James

  11. I’ve just purchased your app but I can’t seem to read this news rss file.

    I’m pretty new coming to android development so please advise.

    “http://www.youm7.com/new3agelrssnew.asp”

    1. Hello Hussein,

      I think that’s because your rss feed format is different from mine. I have update my source code to version 2.4, which will be more compatible with other rss feed format. I will send it to your email.

      Best Regards
      James

  12. I’ve just purchased your code but its not work for my rss news feed.

    please give me advise or teach me how to implement

    “http://rssfeeds.sanook.com/rss/feeds/sanook/horoscope.daily.xml”

    Regards,

    1. Hello Mai,

      Have you pay attention on your Tag in your xml. The time format is quite different from what I defined in the app.

      Yours:
      2014-04-18T00:06:32+07:00

      In the app, please change following line:
      SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, DD MMM yyyy HH:mm:ss", Locale.US);

      Change to:
      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-DD'T'HH:mm:ss", Locale.US);

      Then, it will work for you properly.

      Best Regards
      James

    2. Hello Mai,

      I think you will ask another question like “the app shows blank screen after you click any rss feed item in the list.”

      That is because your rss feed item link look like this:
      http://rssfeeds.sanook.com/rss/go/?horoscope.daily.xml|http://horoscope.sanook.com/myhoro/today/daily/??????????????????????????????????-?????????????-???-19-??????-2557/

      It is a invalid url. That’s why the app cannot load the content from it. You can fix this problem either in your rss side, or you can write some string replace pattern to get the right and valid url from your rss.

      If you want to fix your problem in the app, you can add your code in this section:

      case LINK:
      if (content.length() != 0) {
      if (pdData.postLink != null) {
      pdData.postLink += content;
      } else {
      pdData.postLink = content;
      }
      }
      break;

  13. Hello, purchased your source code (Thanks for the brilliant tutorial btw!) and I have one thing I am a little unclear on. In the activity_pr_list.xml file, there is a section of code that reads:

    What confuses me is that I do not see a “Handmark.pulltorefresh.library.PullToRefreshListView” anywhere in the code. I am trying to adapt it to mine. Is there something I need to copy into my src or layout folders to cover this? Or do I simply rewrite this to:
    com.my.package.name and be done with it?
    Thanks for your help!

    1. Not sure why it cut out my writing but where there is a gap after section of code that reads:, it should say:

      “com.handmark.pulltorefresh.library.PullToRefreshListView”

    1. Hello,

      I have sent an email to your email address which you left on my website. If you have any questions, you can ask here. I will answer it by leaving reply.

      Thanks

  14. Great app by the way , Only problem i faced was that, the webview loads the whole page like in a webrowser. What should i do if want to load the page without ads and other useless stuff. and display the page in a single vertical layout without horizontal scrolling..

    1. Hello,

      It is depending on our data source. To be more clear, it depends on your rss feed. If your website rss feed can give you the whole content, then you can show the content in WebView, instead of loading the url in WebView.

  15. I bought the app. As per the app, it takes the data to list from the given feed url and once we click the link it loads the whole website (the same website hosted). But my requirement is, instead of loading the whole web site, just take the data from the feed burner and show it the App (without loading the original website). i want to have different UI for android app, not same as the website. our feedburner contains all the information. Please let us know how to proceed with this.

    1. Hello,

      It is very easy basically. First, you have to change class “PostData“, which contains the data extracted from your rss feed. After that, you need to pass your data to PostViewActivity when you click the item. In the PostViewActivity, you can show your content in WebView

  16. In my RSS i have a tag and from there i want to get the url and use it as my thumb image in the list view. Already i wrote the Async task to download image.
    in Main Activity i added,
    } else if (xpp.getName().equals(“enclosure”)) {
    currentTag = RSSXMLTag.URL;

    and

    case URL:
    if (content.length() != 0) {
    if (pdData.postThumbUrl != null) {
    pdData.postThumbUrl += content;
    } else {
    pdData.postThumbUrl = content;
    }
    }
    break;

    But it didn’t get any value. i want to just derive URL part from tag and execute that url to download the image. Can you help me on this?

    1. Hello,

      Do you debug in your code? Do you know that currentTag = RSSXMLTag.URL; works properly?

      If currentTag is set as RSSXMLTag.URL, then you have to put a breakpoint in your switch case code. Check if the xml parser get the content your tag.

      Thanks

      1. yes, I have debugged the code. But the output is null. enclosure tag contains the image url and width and height of url. but it does not take those data in the tag. everyt time is is null. for other tags it works, like . but only for this it does not take the data.

          1. He Buddhika,

            In your rss feed, the url is the attribute in enclosure tag. You should wrap your jpg between your tag. Something like:
            http://www.trickslanka.com/wp-content/uploads/android-L-wallpapers.jpg

            Otherwise, you need to use xpp.getAttributeValue(null, "url") to get attribute inside your tag.

            Best Regards
            James

  17. i have tried to use xpp.getAttributeValue(null, “url”). but the problem is it always returns null value for the postthumburl. but in the attribute list image url is there at the [3] position in attribute list. how can i sort out these. please advice.

  18. Hi James,

    please ignore the last comment. I have done it and app is working fine now. Thank you for the continuous support.

  19. Hello, I’ve purchased your app, but it shows 71 errors on start, and I haven’t even edited it at all. Please help. Is there some sort of external file to import?

    1. No need. It is an eclipse project which can work properly. You’d better to clean and rebuild the project. If the error is there, please provide more information such as error messages.

      Thanks

          1. Hello Foppo,

            Have you noticed that your url is not http://www.foit.nl/feed, but http://www.foit.nl/feed1

            Please check the source code and find out following code:
            [code]
            new RssDataController().execute(urlString + 1);
            [/code]

            It’s for page navigation. You can change it as:
            [code]
            new RssDataController().execute(urlString);
            [/code]

  20. The feed seems to be infinitely loading..

    Im on high speed wifi though…

    I decided to change the feed url to yours, and edited out the +1.

    Debug shows some of your articles.

    1. Hello Foppo,

      You make me a little bit confused. OK, let me explain it carefully. I hope it will make you understand the source code and solve some of your problems.

      The source code you got from my website is fully tested with this website. So it will work properly without any changes. So first of all, you’d better to run the original code and make sure you understand how it works.

      After that, you customize the code, for example, with your own url. As your early comment, the 404 problem is because of the page navigation. I suggest you can take a look on these two functions, startFresh() and startLoadMore()

      I hope it can help you 😛

  21. Hi, pretty nice tutorial you got there. I also get you´re source code for futher information but I got one problem. While using RSS-Feed http://www.hs-furtwangen.de/willkommen.html?type=100 , which I require, I am only able to see the latest post. The other ones weren´t there at all and wether it´s your default page or mine it is always January and not October. Would be gread if anyone could help me out because this is a super cool tutorial so far.

    1. 1. For page navigation, you have to check this code:

      startFresh() and startLoadMore()

      In above function, you need to build your rss url to load more rss.

      2. For the date issue, you’d better to check SimpleDateFormatter. This is the Java function to parse the date from string.

    2. Hello Michael,

      For the date problem, there is date format error which will cause your date parsed incorrectly. To fix the problem, please find the follow code
      EEE, DD MMM yyyy HH:mm:ss

      Replace with:
      EEE, d MMM yyyy HH:mm:ss

  22. here is the link (“http://vnrplacements.wordpress.com/feed/”) which is similar to yours.
    when i place my url main screen of my app shows only “click to load more”

    1. Hello,

      Do you notice that my link is “http://jmsliu.com/feed?paged”, but your link is “http://vnrplacements.wordpress.com/feed/”?

      One possible problem is the page navigation. Please search phrase “navigation” on this page. There are lots of comment to help you solve the problem.

      I hope your problem will be solved.

      Thanks

      1. Hello james,
        i added ?paged at the end of my url,
        now its working
        Thanks a lot.
        there is an issue with the date ,its showing january instead of december ,what should i do??

        1. Hello irfan,

          Hello Michael,

          For the date problem, there is date format error which will cause your date parsed incorrectly. To fix the problem, please find the follow code
          EEE, DD MMM yyyy HH:mm:ss

          Replace with:
          EEE, d MMM yyyy HH:mm:ss

          1. thanks a lot james its working now.
            i need one more thing i.e, how to load images
            in the listview,i dont want postthumb_loading pic,i want the post pic.

          1. hi james !!
            along with the title ,author name is showing which i dont want,help me out
            thank you

  23. I purchased the source code and my rss feed has the same structor as yours, however mine only displays 1 item- do you have any suggestions as to what is wrong with the parsing

        1. I got it, it has do do with the following code:
          protected void onPostExecute(ArrayList result) {
          // TODO Auto-generated method stub
          boolean isupdated = false;
          for (int i = 0; i < result.size(); i++) {
          // check if the post is already in the list
          // if (guidList.contains(result.get(i).postGuid)) {
          // continue;
          // } else {
          isupdated = true;
          guidList.add(result.get(i).postGuid);
          // }

          the GUID must not be unique because I comment it out" as shown" and the code works!

  24. Hey James…

    Please, Could you help me, whit this

    nativeOnDraw failed; clearing to background color.

    in Web view

    Thanks

  25. Hi James,

    just paid for your source code of the RSS-Tutorial and already sent you a mail.

    Could I get the download link? Thank you very much!

    1. Hi Daniel,

      After you make the payment, the download link should appear in your payment window. Anyway, I sent the source code to your email. Please check your email.

      Best Regards
      James

  26. Thanks, James!

    Just bought the tutorial 7 version. Could you sent me via mail the current version of it?

    thank you very much!

  27. i don’t get the JmsliuStyle.java

    “JMSLIU.COM” +
    “” +
    “” +
    “”

    where you get that info? i cant find it on my site…
    please help me.

    1. that’s not from the website. It is for in app webview, write by myself. The purpose is making the content presented in webview much better.

  28. Hi sir, thanks for this great tutorial.

    I need to show difference between read and unread items in the lstview.

    1. App only receive push notification. To support this, you need to develop a function in your website. So when your website publishes a new post, you need to send a notification.

      1. Thanks for replying sir.I am from India.My paypal account is not activated.Is there any other way to buy source code.

  29. hi Sir,
    will u please send me the code for reference and which feed url is best to fetch technology news in android app ?

      1. hi James,
        I tried allot, but It result in fetching very few news.
        If you can let me the feed url to fetch technology news, I’ll be thankful..

        1. If you cannot be sure that if this source code support your rss feed, you may check if your website rss feed format is the same as what I mentioned in tutorial 3

  30. Hi James. I paid paypal “Get Full Source Code under $6.99”
    But, I could not download. 🙁
    need urgent help, Please

    1. Hi Yusuf,

      Sorry about my server fault. As limited server resource, my hosting sometimes gets error. I will send the source code to your email (yahoo.com one) which you are using to make the payment.

  31. unable to run the app on an emulator.

    This is the content of log.txt:
    11-16 07:57:19.697: W/System(2420): ClassLoader referenced unknown path: /data/app/com.jms.rssreader-1/lib/x86
    11-16 07:57:20.290: I/art(2420): Rejecting re-init on previously-failed class java.lang.Class
    11-16 07:57:20.292: I/art(2420): Rejecting re-init on previously-failed class java.lang.Class
    11-16 07:57:20.313: I/GAv4(2420): Google Analytics 8.2.98 is starting up. To enable debug logging on a device run:
    11-16 07:57:20.313: I/GAv4(2420): adb shell setprop log.tag.GAv4 DEBUG
    11-16 07:57:20.313: I/GAv4(2420): adb logcat -s GAv4
    11-16 07:57:20.347: W/GAv4(2420): AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.gl/8Rd3yj for instructions.
    11-16 07:57:20.349: W/GAv4(2420): CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See http://goo.gl/8Rd3yj for instructions.
    11-16 07:57:20.353: W/GAv4(2420): AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions.
    11-16 07:57:20.427: W/GooglePlayServicesUtil(2420): Google Play services out of date. Requires 8298000 but found 8185470
    11-16 07:57:20.427: W/Ads(2420): Using InterstitialAdManager from the client jar.
    11-16 07:57:20.486: D/AndroidRuntime(2420): Shutting down VM
    11-16 07:57:20.489: E/AndroidRuntime(2420): FATAL EXCEPTION: main
    11-16 07:57:20.489: E/AndroidRuntime(2420): Process: com.jms.rssreader, PID: 2420
    11-16 07:57:20.489: E/AndroidRuntime(2420): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/SimpleArrayMap;
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.google.android.gms.ads.internal.zzq.(Unknown Source)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.google.android.gms.ads.internal.zzq.(Unknown Source)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.google.android.gms.ads.internal.zzb.(Unknown Source)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.google.android.gms.ads.internal.zzc.(Unknown Source)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.google.android.gms.ads.internal.zzk.(Unknown Source)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.google.android.gms.ads.internal.client.zze.zzb(Unknown Source)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.google.android.gms.ads.internal.client.zzaa.zzM(Unknown Source)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.google.android.gms.ads.internal.client.zzaa.zza(Unknown Source)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.google.android.gms.ads.InterstitialAd.loadAd(Unknown Source)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.jms.rssreader.MainActivity.initAds(MainActivity.java:126)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.jms.rssreader.MainActivity.onCreate(MainActivity.java:89)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at android.app.Activity.performCreate(Activity.java:6237)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at android.app.ActivityThread.-wrap11(ActivityThread.java)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at android.os.Handler.dispatchMessage(Handler.java:102)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at android.os.Looper.loop(Looper.java:148)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at android.app.ActivityThread.main(ActivityThread.java:5417)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at java.lang.reflect.Method.invoke(Native Method)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    11-16 07:57:20.489: E/AndroidRuntime(2420): Caused by: java.lang.ClassNotFoundException: Didn’t find class “android.support.v4.util.SimpleArrayMap” on path: DexPathList[[zip file “/data/app/com.jms.rssreader-1/base.apk”],nativeLibraryDirectories=[/data/app/com.jms.rssreader-1/lib/x86, /vendor/lib, /system/lib]]
    11-16 07:57:20.489: E/AndroidRuntime(2420): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    11-16 07:57:20.489: E/AndroidRuntime(2420): … 23 more
    11-16 07:57:20.489: E/AndroidRuntime(2420): Suppressed: java.lang.ClassNotFoundException: android.support.v4.util.SimpleArrayMap
    11-16 07:57:20.489: E/AndroidRuntime(2420): at java.lang.Class.classForName(Native Method)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
    11-16 07:57:20.489: E/AndroidRuntime(2420): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
    11-16 07:57:20.489: E/AndroidRuntime(2420): … 24 more
    11-16 07:57:20.489: E/AndroidRuntime(2420): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
    11-16 07:57:20.587: I/art(2420): Rejecting re-init on previously-failed class java.lang.Class
    11-16 07:57:20.587: I/art(2420): Rejecting re-init on previously-failed class java.lang.Class
    11-16 07:57:20.587: I/art(2420): Rejecting re-init on previously-failed class java.lang.Class
    11-16 07:57:20.588: I/art(2420): Rejecting re-init on previously-failed class java.lang.Class
    11-16 07:57:20.594: W/GooglePlayServicesUtil(2420): Google Play services out of date. Requires 8298000 but found 8185470
    11-16 07:57:20.595: E/GooglePlayServicesUtil(2420): GooglePlayServices not available due to error 2

    1. As you can see, your Google Play services is out of date. Please update your google play services library and the problem will be solved.

  32. Hi! i have pay but i want to know how tu use your source code with google news please it urgent.

    and why i have this :

    oglenewsreader E/AndroidRuntime: FATAL EXCEPTION: main
    Process: walson.esgi.al.googlenewsreader, PID: 3863
    java.lang.RuntimeException: Unable to start activity ComponentInfo{walson.esgi.al.googlenewsreader/walson.esgi.al.googlenewsreader.ArticleViewActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.webkit.WebView.loadData(java.lang.String, java.lang.String, java.lang.String)’ on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
    at android.app.ActivityThread.-wrap11(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.webkit.WebView.loadData(java.lang.String, java.lang.String, java.lang.String)’ on a null object reference
    at walson.esgi.al.googlenewsreader.ArticleViewActivity.onCreate(ArticleViewActivity.java:22)
    at android.app.Activity.performCreate(Activity.java:6237)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
    at android.app.ActivityThread.-wrap11(ActivityThread.java) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:148) 
    at android.app.ActivityThread.main(ActivityThread.java:5417) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

    1. Hello,

      Before you are using my project with other rss feed, you need to make sure their rss xml is same with my website rss xml. In my example, I add some customized xml tag in my xml feed. Therefore, you need to read the code and disable some parse.

      In your problem pasted on my website, it is a very simple problem. When you click a rss item in the list, it will try to open its link in a webview. If you cannot get the rss item link in your rss, you have to replace this with your own source code.

      Best Regards
      James

  33. Hi James, I have downloaded your source code and change the Rss feed link to mine but it is not working. Any time i run the app it opens but my feed doesn’t show, and also when I on the item it crashes. Is there anyway I can send you my code to that you can check it for me please?

        1. If the rss feed is working and you click on item to cause the app crash, that means you rss feed doesn’t provide enough data. To solve the problem, please check the tutorial 3. In the RssDataController source code, I am doing the XML parse job. Please make sure your rss feed provides the Title, Link, and Data. Also check onItemClickListener source code,

          postInfo.putString(“content”, data.postContent);

          See if postContent is empty or not.

          1. How can i check whether the postContent is empty, sorry am new to android development.

  34. Hello, I have some problems with this code. (I bought full version of this one).

    First – it starts to update even if the list is not max. to the top, even is its on the bottom – if i swipe a low up and down – its starts updating. I 100% copied your RefreshableListView module, my own code does not interfere. This view modules are contained inside fragments in ViewPager.

    Will describe second error later.

    1. Second problem is that if I try to clear list with listData.clear(); and then repopulate it – program crashes shortly after in the middle of swiping with error “ArrayList java.lang.IndexOutOfBoundsException: Invalid index 9, size is 1” – indexes may change. The error is not pointing on any of my code files, only standard java libraries. It occures somewhere in RefreshableListView file, I’ve been trying to locate and catch it for several hours now.

      Sorry for broken english.

      1. That must be a logic error. The error message means the array only has 1 element, but you want to get index 9; Again, I think you already put my source code into your project, and add more logic code inside. My suggestion is that check the index when you clear the listData.

    2. Do you try my original source code? I cannot answer your questions if you mix the source code with your own project.

      1. I already said – only your original code is working with touch events, and their calls – mine works with database, connections, etc. I think it happens because there is an error somewhere in the code that triggers the update (one which calculates position of the current list location).

        1. If the original code is working, then if you can provide enough data, it should not have any problem. If there is an error in the code which triggers the update, why does the update work in the original code?

      2. EDIT: Just found some weird data – whenever i try to move in any direction, getPaddingTop ALWAYS starts with -60. so when i move 120 dp UP the list – it starts the update. I havn’t changed your code at all, just put some log.d in it to check for data output.

  35. Hi James,

    I just purchased the source code for the project but when i clicked download it came up ‘invalid request’ and i don’t have the source code. Can you help?

    1. Hi, actually there are several rss standards. And website is not forced to follow any of them. Therefore, every website can follow one of the standard, or they also can customize their own rss feed format.

          1. done compare, i think all same there are no content encode, any alternative to display rss post content ? ty

          2. yeah i was do that, on the load url link content its display webpages, i want just text, any idea?

Leave a Reply to Vishal Cancel reply

Your email address will not be published. Required fields are marked *