0

I have spent the day researching Android RSS Readers.

I would like to parse a very simple XML file in my app. http://www.sportinglife.com/rss/transfer_wire.xml

There are several threads on this site answering RSS questions, such as https://stackoverflow.com/questions/1253788/simple-rss-parser-for-android. I have tried all the solutions in this but I keep getting errors in Eclipse when running the code.

I have found a recent IBM Tutorial from April 2012, which explains the code very well and offers a solution in just one class file. http://www.ibm.com/developerworks/xml/library/x-androidxml/index.html

I have followed this tutorial step by step, but Eclipse throws the following error:

[Dex Loader] Unable to execute dex: Unexpected magic: [100, 101, 120, 10, 48, 49, 51, 0]
[FootballTransfers] Conversion to Dalvik format failed: Unable to execute dex: Unexpected magic: [100, 101, 120, 10, 48, 49, 51, 0]

Has anybody encountered this problem before? I have no idea what this error means.

I get the same error when I run the solutions offered in the https://stackoverflow.com/questions/1253788/simple-rss-parser-for-android thread.

6
  • samir-mangroliya.blogspot.in/p/android-customized-listview.html Commented May 29, 2012 at 17:05
  • @SamirMangroliya Thanks dude. I will give this a go and get back to you. I found this tutorial online, imported it into Eclipse. When I run, I get the 'Conversion to Dalvik format failed' message again. If the same happens for your solution, there is definitely something wrong with my IDE. Commented May 29, 2012 at 17:23
  • yes definately because this tuts working nice in my eclipse. Commented May 29, 2012 at 17:24
  • @SamirMangroliya Same error. I go to File -> New -> Other -> Android Project. Then I select 'Create project from existing source'. I chose the folder your solution is stored in. I then went to Window -> Clean. When I run the project, I get the same error I detailed in my answer. Can anybody help with this? Commented May 29, 2012 at 17:39
  • google.co.in/… Commented May 29, 2012 at 17:41

1 Answer 1

1

pass inputstream instead of urls

 @Override
        protected Void doInBackground(String... urls) {

 arrayList = new NewsParser().getData(NewsMainActivity .this.getResources.openRawResourece(R.xml.feed));

            return null;
        }

and in getData method change parameter to InputStream.

 public List<NewsBean> getData(InputStream istream) {
    DocumentBuilder builder = DocumentBuilderFactory.newInstance()
                    .newDocumentBuilder();

            System.out.println("Builder : " + builder);

            Document doc = builder.parse(istream);
    Document doc = builder.parse(istream);
.....
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your help dude! I got my RSS Feed working perfectly on my app :-) If you have the code so that images could be parsed as well, please share!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.