Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.source=1.6
2 changes: 1 addition & 1 deletion project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-16
target=android-19
4 changes: 4 additions & 0 deletions src/com/nerdability/android/adapter/ArticleListAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public View getView(int position, View convertView, ViewGroup parent) {
} catch (ParseException e) {
Log.e("DATE PARSING", "Error parsing date..");
pubDate = "published by " + article.getAuthor();
} catch (NullPointerException e){
//In some case, the author for the article is not available.It may give NullPointerException.
Log.e("Get Author","Error to get author");
dateView.setVisibility(View.GONE);
}
dateView.setText(pubDate);

Expand Down
17 changes: 15 additions & 2 deletions src/com/nerdability/android/rss/parser/RssHandler.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package com.nerdability.android.rss.parser;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import android.net.Uri;

import com.nerdability.android.rss.domain.Article;


Expand Down Expand Up @@ -65,16 +69,25 @@ public void endElement(String uri, String localName, String qName) throws SAXExc
currentArticle.setTitle(chars.toString());
} else if (localName.equalsIgnoreCase("description")){
currentArticle.setDescription(chars.toString());
} else if (localName.equalsIgnoreCase("pubdate")){
currentArticle.setPubDate(chars.toString());
} else if (localName.equalsIgnoreCase("published")){
currentArticle.setPubDate(chars.toString());
} else if (localName.equalsIgnoreCase("id")){
currentArticle.setGuid(chars.toString());
} else if (localName.equalsIgnoreCase("author")){
currentArticle.setAuthor(chars.toString());
} else if (localName.equalsIgnoreCase("content")){
} else if (localName.equalsIgnoreCase("link")){
try {
currentArticle.setUrl(new URL(chars.toString()));
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else if (localName.equalsIgnoreCase("content")){
currentArticle.setEncodedContent(chars.toString());
} else if (localName.equalsIgnoreCase("entry")){

}


Expand Down