Problems with Parsing

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

Problems with Parsing

Postby Chri » Mon Aug 31, 2009 12:17 pm

Hi!

Thanks for your beautiful tutorial!

But now i have 2 important questions!!

1. I coppied the code but it doesnt work really well!
the number is shown but the string does not!
I debugged it and saw that there are 3 runs when the string is readed:
the first run show me /n/t
the second /t/t/t anddev rules =)
and the third /n

and so only /n is desplayed!!!

2. I would like to parse a string instead of an url! How can i do that?

please help! it´s very urgent!!!
Chri
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Mon Aug 31, 2009 12:08 pm

Top

Re: Problems with Parsing

Postby jyoti » Tue Sep 01, 2009 5:22 am

Chri wrote:Hi!

Thanks for your beautiful tutorial!

But now i have 2 important questions!!

1. I coppied the code but it doesnt work really well!
the number is shown but the string does not!
I debugged it and saw that there are 3 runs when the string is readed:
the first run show me /n/t
the second /t/t/t anddev rules =)
and the third /n

and so only /n is desplayed!!!






hello
chri


this is my code and it runs perfect

n show both string and integer
check ur code with it.
Attachments
ParsingXML.zip
(32.04 KiB) Downloaded 109 times
jyoti
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Aug 25, 2009 1:39 pm

Thanks

Postby Chri » Tue Sep 01, 2009 8:48 am

Thanks for you file! It works!!!

But i also would like to parse a extern xml file or better a string!

Does Anybody know how?

mfg Chri
Chri
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Mon Aug 31, 2009 12:08 pm

Re: Thanks

Postby jyoti » Tue Sep 01, 2009 9:11 am

Chri wrote:Thanks for you file! It works!!!

But i also would like to parse a extern xml file or better a string!

Does Anybody know how?

mfg Chri


hello


do u know how to run downloaded application directly on my workspace
without creating the copy of that?


i import the project
but it's not working


plz tell me........
thanks in advance
jyoti
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Aug 25, 2009 1:39 pm

Re: Thanks

Postby Chri » Tue Sep 01, 2009 9:27 am

jyoti wrote:
Chri wrote:Thanks for you file! It works!!!

But i also would like to parse a extern xml file or better a string!

Does Anybody know how?

mfg Chri


hello


do u know how to run downloaded application directly on my workspace
without creating the copy of that?


i import the project
but it's not working


plz tell me........
thanks in advance


What do you want? I don´t understand!!

mfg Chri
Chri
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Mon Aug 31, 2009 12:08 pm

Re: Thanks

Postby jyoti » Tue Sep 01, 2009 9:34 am

What do you want? I don´t understand!!

mfg Chr





hello
how can i run android project(downloaded from net)
jyoti
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Aug 25, 2009 1:39 pm

Top

Postby Chri » Tue Sep 01, 2009 9:53 am

Do you use eclipse?
Chri
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Mon Aug 31, 2009 12:08 pm

Postby jyoti » Tue Sep 01, 2009 9:58 am

Chri wrote:Do you use eclipse?



yes
jyoti
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Aug 25, 2009 1:39 pm

Postby Chri » Tue Sep 01, 2009 10:04 am

After you downloaded the project got to ecplipse, press File/New/AndroidProject;
At "Contents" click "Create project from existing source"
and then browse where your downloaded project is!

mfg Chri
Chri
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Mon Aug 31, 2009 12:08 pm

Postby jyoti » Tue Sep 01, 2009 10:06 am

Chri wrote:After you downloaded the project got to ecplipse, press File/New/AndroidProject;
At "Contents" click "Create project from existing source"
and then browse where your downloaded project is!

mfg Chri



yes i did that
but after that when i open .java files from that application

this show error

or did not work
jyoti
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Aug 25, 2009 1:39 pm

Postby Chri » Tue Sep 01, 2009 10:13 am

could you send me that file? Then i will try to fix it!
Chri
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Mon Aug 31, 2009 12:08 pm

Postby jyoti » Tue Sep 01, 2009 10:42 am

Chri wrote:could you send me that file? Then i will try to fix it!


that is my prb

all files show error on correct syntex
jyoti
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Aug 25, 2009 1:39 pm

Postby Chri » Tue Sep 01, 2009 11:01 am

where do you downloaded this file?
Chri
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Mon Aug 31, 2009 12:08 pm

Re: Problems with Parsing

Postby noya » Wed Sep 02, 2009 10:32 am

Chri wrote:
2. I would like to parse a string instead of an url! How can i do that?

please help! it´s very urgent!!!


To parse a string you have to use a ByteArrayInputStream and pass a String converted in a byte[] using getBytes();

ByteArrayInputStream tobeparsed = new ByteArrayInputStream(aString.getBytes());

then you pass this stream to the method parse of XMLReader:

xr.parse(new InputSource(tobeparsed));
User avatar
noya
Junior Developer
Junior Developer
 
Posts: 14
Joined: Fri May 08, 2009 3:16 pm
Location: Bergamo, Italy

Thanks

Postby Chri » Wed Sep 02, 2009 11:06 am

Now it works beatiful!!!

Thank you very much!!!
Chri
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Mon Aug 31, 2009 12:08 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests