Parsing XML from the Net - Using the SAXParser

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Re: Parsing XML from the Net - Using the SAXParser

Postby HappyEnding » Tue Jan 24, 2012 5:37 pm

Your parser works fine for me using a local xml file.

Unfortunately I get a null exception at this line

Code: Select all
xr.parse(new InputSource(url.openStream()));


when trying to load data from an url.

Some tip?
HappyEnding
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Jan 24, 2012 10:38 am

Top

Re: Parsing XML from the Net - Using the SAXParser

Postby prabu » Tue Jan 31, 2012 1:29 pm

informative!!
prabu
Freshman
Freshman
 
Posts: 6
Joined: Thu May 26, 2011 10:25 am

Re: Parsing XML from the Net - Using the SAXParser

Postby justStudyIt » Fri Mar 09, 2012 1:32 pm

i have copied all of your codes, but i can't get the extracted string :(
please, help me :)
justStudyIt
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Mar 09, 2012 1:30 pm

Re: Parsing XML from the Net - Using the SAXParser

Postby ramyaG » Tue Mar 27, 2012 2:03 am

Hi,

I am a beginner in Android Development.
I have copied all your java files exactly and trying to execute.
But, I keep on getting the following error:
"The method setContentHandler(ContentHandler) in the type XMLReader is not applicable for the arguments (ExampleHandler)"

Please let me know if I have to change anything to make it work.
I appreciate your help.

Regards,
Ramya
ramyaG
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Mar 27, 2012 1:57 am

Re: Parsing XML from the Net - Using the SAXParser

Postby Bakim » Sun Jun 17, 2012 5:08 am

Hi there thank you for the tutorial i am trying to make my first android app which is a shoutcast radio player i managed to make two buttons(play and stop) the player works ok i also made a textview that gets data (artist title album) from a xml file located on a webserver using the saxparser the only problem i have is when the data updates from the xml the textview doesnt update how do i get this to work will i have to use a service or a async task if yes can you please explain how with a sample thanks in advance
Bakim
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Jun 17, 2012 4:38 am

Re: Parsing XML from the Net - Using the SAXParser

Postby VIGNESH.SRINIVASAGAN » Mon Aug 13, 2012 7:32 am

Hi PlusMinus ,
in the ParsedExampleDataSet class , i could not return the string from this method to the ExampleHandler class . i checked whether am getting it from api but i got that string in extractedString outside this method but could not get the same string inside this method .

public String toString(){
Log.e("", ""+this.extractedString);
Log.e("", ""+this.extractedInt);
return "ExtractedString = " + this.extractedString
+ "nExtractedInt = " + this.extractedInt;
}

the integer term is returning but not that extractedString .
could u plz tell me how to fix this .
i just copied your code and pasted it in eclipse but could not retreive the string anddev.org rulez =)

and my output is as : ExtractedString = nExtractedInt = 1337
VIGNESH.SRINIVASAGAN
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Aug 13, 2012 7:17 am

Top

Re: Parsing XML from the Net - Using the SAXParser

Postby ozelgoktug » Wed Feb 27, 2013 6:34 pm

Hello. Firstly I must to say that This Web Site is awesome! And so clear.
I have some questions. Is this helps me for I want to control my phone from my computer on internet with xml? My project is controll an android car from my pc on net? Is XML helps me for this? I will write a C# desktop program and this program will send my keyboard's up - down - left - right datas. And I want to read this data with android phone on net and controll my car. Can I do it with XML? Can I read this datas momently? Actualy its not problem for 1-2 second.. Could u help me pls How must i follow a way? My english is not very good. Im sorry for this reason. And Could u write your answer basicly pls =) :)
ozelgoktug
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Feb 27, 2013 6:17 pm

Re: Parsing XML from the Net - Using the SAXParser

Postby GLeonio » Mon Mar 25, 2013 10:39 pm

Thank you for this thread! I compiled a list of some other top tutorials for parsing XML using sax parser. Hope this can be useful to other developers also. http://www.verious.com/board/Giancarlo- ... sax-parser :)
GLeonio
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Mar 25, 2013 10:35 pm

java.net.UnknownHostException

Postby jamesgacho » Thu Apr 18, 2013 11:26 am

Hi,

Thanks for the tutorial its very clear and precise. I have tried to use it to retrieve an RSS feed but am always getting the "java.net.UnknownHostException" error. I thought that the problem might be with the site itself so I went through this tutorial word for word and then I got the same error (java.net.UnknownHostException: http://www.anddev.org). I am getting very frustrated. I have added the appropriate permission in the android.manifest file, have ensured that the AVD can actually access the net which it did without problems and even opens the file in a browser - So what could I be doing wrong?

PS: Its also not working on the phone!
jamesgacho
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Apr 15, 2013 2:08 pm

Re: Parsing XML from the Net - Using the SAXParser

Postby sarath12 » Sun May 19, 2013 9:28 am

Superb Tutorial !!! Thanks .............. God Bless U .
sarath12
Once Poster
Once Poster
 
Posts: 1
Joined: Sun May 19, 2013 9:22 am

Re: Parsing XML from the Net - Using the SAXParser

Postby za_allsite » Tue May 21, 2013 9:26 pm

thats Informative.
Thanks Advance.
za_allsite
Freshman
Freshman
 
Posts: 2
Joined: Tue May 21, 2013 8:16 pm

Top
Previous

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests