RSS Reader Android App Tutorial 5: Show WebSite Content in WebView

On June 30, 2013, in Android, by James Liu

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;
Tagged with:  

161 Responses to “RSS Reader Android App Tutorial 5: Show WebSite Content in WebView”

  1. Alex says:

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

    • James says:

      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. James says:

    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. marco says:

    hi, i just buyed the source but it wont let me download.
    it says that chrom e cant download file.

  4. Willem says:

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

  5. Ponto says:

    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.

    • James says:

      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

  6. 6xhhs says:

    HI i would like to purchase the source code but i have a few issues which i need clarified,can we communicate through mail

  7. Boukhsibi says:

    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.

    • James says:

      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

  8. Boukhsibi says:

    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.

    • James says:

      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

  9. Andrea says:

    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

    • James says:

      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

      • Andrea says:

        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

        • James says:

          Hi Andrea,

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

          Best Regards
          James

          • Andrea says:

            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

  10. Andrea says:

    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

    • James says:

      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

  11. srihari says:

    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.

  12. Mirai says:

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

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

    • James says:

      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.

      • Mirai says:

        Ok thank you, i’m placing it above the code in PostViewActivity, but i’m still at a loss as to where it should be correctly placed.
        Here’s a screenshot of it so far.
        https://dl.dropboxusercontent.com/u/9420482/Screenshot%202014-03-16%2018.04.28.png
        Are you saying it should be in one of the .xml files?

        • Mirai says:

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

          • Mirai says:

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

          • James says:

            Learning how to debug Android App is quite important.

          • Mirai says:

            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.

          • James says:

            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

  13. Hussein says:

    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”

    • James says:

      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

    • omar hassan says:

      Husin please give me ur email pleaseeee

  14. Mai says:

    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,

    • James says:

      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

    • James says:

      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;

  15. Patrick says:

    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!

    • Patrick says:

      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”

    • James says:

      Hello,

      The file activity_pr_list.xml is not used in the project. You can delete it.

      Thanks

  16. TAEL says:

    Hi James,

    What is your email address?

    Thanks

    • James says:

      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

  17. Raj Khan says:

    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..

    • James says:

      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.

  18. Buddhika says:

    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.

    • James says:

      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

  19. Buddhika says:

    Hi,

    I want to add thumbnail image which is related to the post to the list view.
    As per my rss the thumbnail image url is under the description tag.

    <description><<img alt="joana soares rostos" src="http://loc.grupolusofona.pt/images/stories/varios/joana%20soares%20rostos.jpg"/&gt; <p> lorel epsum lorel epsum lorel epsum lorel epsum </p></description>

    Please let me know the most efficient way to do it?

  20. Buddhika says:

    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?

    • James says:

      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

      • Buddhika says:

        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.

  21. Buddhika says:

    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.

  22. Buddhika says:

    Hi James,

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

  23. Molly says:

    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?

    • James says:

      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

  24. Foppo says:

    When i try to run your code, the app throws a 404 not found..

    feed is from wordpress

  25. Foppo says:

    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.

    • James says:

      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 😛

  26. Michael says:

    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.

    • James says:

      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.

    • James says:

      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

  27. bird says:

    hi James
    please….. rss feed example code with postThumbUrl

  28. irfan says:

    Hi James!!
    thanks for this tutorial,
    i installed ur app it works fine with ur URL(http://jmsliu.com/feed?paged)
    but when i replaced it with my URL it does show anything.
    help me out

  29. irfan says:

    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”

    • James says:

      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

  30. Matt says:

    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

  31. Irwing says:

    Hey James…

    Please, Could you help me, whit this

    nativeOnDraw failed; clearing to background color.

    in Web view

    Thanks

  32. darshan says:

    plz any one can help me

  33. Daniel says:

    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!

  34. Daniel says:

    Thanks, James!

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

    thank you very much!

  35. Stefan says:

    i don’t get the JmsliuStyle.java

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

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

  36. xxx says:

    Hi sir, thanks for this great tutorial.

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

  37. xxx says:

    Is it working in Android Studio?

  38. xxx says:

    Is this app give push notifications?

  39. Vishal says:

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

  40. Attila says:

    Hi,

    i was unable to pay with your paypal plugin.

    Pls Help to get your great app.

    Attla

  41. Abdul Aziz says:

    hi, it will support for wordpress website ??

  42. Yusuf says:

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

  43. Jason says:

    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

    • James Liu says:

      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.

  44. Fosphate says:

    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) 

    • James Liu says:

      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

  45. ranaz says:

    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?

  46. NIKENIT says:

    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.

    • NIKENIT says:

      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.

      • James Liu says:

        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.

    • James Liu says:

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

      • NIKENIT says:

        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).

        • James Liu says:

          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?

      • NIKENIT says:

        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.

  47. Daniel says:

    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?

  48. Mostafa Omar says:

    Hey there,
    I purchased the source code since 2 months (as I recall), but I lost it.
    Can you resend to me
    The purchase was with my paypal account with the mail: kateb_masry@yahoo.com

  49. Frank says:

    Hello,

    Can we communicate through email. I have few questions on implementation.

  50. Azmil says:

    why the date different from rss to our rss feed ? TY

Leave a Reply

WordPress Themes

Free WordPress Themes