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

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

Rss Reader Android App Tutorial 4: Drag to Refresh in ListView Android Example

New Update: Adding Loading More in FooterView
Several weeks ago, I created a IOS tutorial about how to implement pull to refresh in IOS UITableView. In my Rss reader android app, I also want to add pull to refresh feature so that user can easily update the ListView content. I searched online and spend several to integrate one open source project in my Android ListView example. After that, I find it is quite hard to make some change basing on the open source project because of its poor flexibility. Therefore, I decide to create my own drag to refresh ListView (or called pull to refresh ListView).

In my app, I will create a subclass of ListView which is called RefreshableListView. The new ListView class will allow user to drag down and trigger loading event. So my RefreshableListView will implement the interface OnScrollListener and override the interface functions onScroll and onScrollStateChanged; To track user interactions, I will override the function onTouchEvent as well. Once we drag down the ListView, we will see the headerView which gives a tip “Pull Down to Update”. If we release ListView, the headerView will stay on the top and wait for updating. Once the updating processing finishes, the headerView will shrink back and disappear. Now let’s see the example source code step by step.
Read more

Rss Reader Android App Tutorial 3: Parse XML in Android

In the previous tutorial about Rss Reader Android app, I gave the example code about how to get the data from website using AsyncTask. After we get the data, we have to read it and convert the format to server our app. XML is the standard data format for RSS. In this android example, I will show you how to parse XML in Android. If you are first time to read this post, I think you also are interested in reading the these two examples:

Read more

Adding Admob Banner in Android ListView Header

Adding AdMob ads banner in ListView header is quite difficult, comparing with adding ads banner in IOS UITableView header. It is simply because there is no header section for ListView in Android. But IOS UITableView has and UITableViewDelegate offers a very convenient way to customize the header and footer. For Android ListView, we have two ways to solve the problem. In this Android AdMob example, I will show you how to add AdMob Banners in Android ListView App.

Read more