Help | RSS Reader Feeds | Socket Exception

by Gaurav » Tue, 28 Apr 2009 22:20:50 GMT


Sponsored Links
 i,

I am trying to access rss feeds :

RSSFEEDOFCHOICE = "http://rss.news.yahoo.com/rss/entertainment";

Below is the code:

try
{
// setup the url
URL url = new URL(urlToRssFeed);

// create the factory
SAXParserFactory factory = SAXParserFactory.newInstance();
// create a parser
SAXParser parser = factory.newSAXParser();

// create the reader (scanner)
XMLReader xmlreader = parser.getXMLReader();
// instantiate our handler
RSSHandler theRssHandler = new RSSHandler();
// assign our handler
xmlreader.setContentHandler(theRssHandler);
Log.i("getFeed", "before inputsource ");
// get our data via the url class

//InputSource is = new InputSource(inputStream);
InputSource is = new InputSource();
is.setByteStream(url.openConnection().getInputStream());
// perform the synchronous parse
xmlreader.parse(is);
// get the results - should be a fully populated RSSFeed
instance, or null on error
return theRssHandler.getFeed();
}
catch (Exception ee)
{
Log.e("getFeed", "ee ==> " +ee.getMessage(),ee);

// if we have a problem, simply return null
return null;
}


below is the exception trace:

04-28 19:47:54.155: INFO/RSSReader: onCreate(854): START
04-28 19:47:54.226: INFO/RSSReader: onCreate(854): RSSFEEDOFCHOICE
http://rss.news.yahoo.com/rss/entertainment
04-28 19:47:54.235: INFO/getFeed(854): urlToRssFeed ==>
http://rss.news.yahoo.com/rss/entertainment
04-28 19:47:54.306: INFO/getFeed(854): before inputsource
04-28 19:47:54.355: ERROR/OSNetworkSystem(854): unknown socket error
-1
04-28 19:47:54.389: ERROR/getFeed(854): ee ==> unknown error
04-28 19:47:54.389: ERROR/getFeed(854): java.net.SocketException:
unknown error
04-28 19:47:54.389: ERROR/getFeed(854): at
org.apache.harmony.luni.platform.OSNetworkSystem.createSocketImpl
(Native Method)
04-28 19:47:54.389: ERROR/getFeed(854): at
org.apache.harmony.luni.platform.OSNetworkSystem.createSocket
(OSNetworkSystem.java:79)
04-28 19:47:54.389: ERROR/getFeed(854): at
org.apache.harmony.luni.net.PlainSocketImpl2.create
(PlainSocketImpl2.java:59)
04-28 19:47:54.389: ERROR/getFeed(854): at
java.net.Socket.checkClosedAndCreate(Socket.java:763)
04-28 19:47:54.389: ERROR/getFeed(854): at java.net.Socket.connect
(Socket.java:910)
04-28 19:47:54.389: ERROR/getFeed(854): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>
(HttpConnection.java:61)
04-28 19:47:54.389: ERROR/getFeed(854): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager
$ConnectionPool.getHttpConnection(HttpConnectionManager.java:145)
04-28 19:47:54.389: ERROR/getFeed(854): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection
(HttpConnectionManager.java:67)
04-28 19:47:54.389: ERROR/getFeed(854): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection
(HttpURLConnection.java:800)
04-28 19:47:54.389: ERROR/getFeed(854): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect



Other Threads

1. Want to execute arm compiled executable file on Android adb shell



I may be wrong, but I think the sdcard is mounted with the NOEXEC
flag, so you can't run programs from there. The best way is to
integrate the executable into your app as a native library using the
NDK.

-- 

2. Harga broadband 3 tetap 85rb/bl

Khusus pelanggan lama yg daftar dari waktu masih 85rb/bln.. ada yg denger
hal yg sama?

Gw sih td dtelpon ma 3care, awalnya dblgin ada promo nelpon gratis 3 hari ke
sesama 3 klo isi ulang.. trus gw blg mo cuti dulu pake broadband-nya 1 bln
(mo ngungsi sebulan ke oz, dsuru nyangkul dsono ma kantor), abis itu dpt
tambahan info yg di atas.. jd batal cuti 1 bln-nya deh.. :P

Smoga gw ga salah denger infonya..

..nexus...@cyanogenmod-5.0.6..

-- 
"Indonesian Android Community [id-android]" 

3. Anyone interested in trading and N1 for Droid

4. Android Developer Device Seeding Program - still active?

5. CheckedListView sparse boolean array

6. phone-as-client Socket connections time out in 3GS mode, but work fine in wifi

7. Ask:HTC Dream G1..masih bisa apa?