Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Contributor
sheetal2811
Posts: 21
Registered: ‎08-25-2011
My Carrier: developer

live xml parsing source code

hi i want parse a xml whic is on  the web..i hv try many code but it doesnot work....

but local parsing works!!!

and pls also tell me that if a tag have image url or video url how can i fatch that image and video!!!!

pls help me as soon s possible !!!!

Please use plain text.
Developer
peter_strange
Posts: 17,713
Registered: ‎07-14-2008

Re: live xml parsing source code

Welcome to the forums.

 

It is possible to process XML feeds from the Internet, you just need to open a connection to them.

 

Look at httpDemo as an example of how you can get XML data (in httpDemo case, change the URL and you could get XML data) on the phone for parsing. 

 

Normally with XML, the tag will identify the URL for an image, and you will have to download it, again httpDemo will help you download the bytes, then you will need to convert the bytes to an image.

 

Questions like this are asked quite frequently on this forum, I recommend that do a search and look for more information and alternative answers. 

Please use plain text.
Contributor
sheetal2811
Posts: 21
Registered: ‎08-25-2011
My Carrier: developer

Re: live xml parsing source code

ve this url :  http://www.androidpeople.com/wp-content/uploads/2010/06/example.xml

 

can any body send parsing code for fatching name tag ...

pls send code according to this url;

Please use plain text.
Developer
peter_strange
Posts: 17,713
Registered: ‎07-14-2008

Re: live xml parsing source code

If you pay me enough I will write the rest of your application too!  :smileyvery-happy:

 

Seriously, I think the point of this forum is help fellow developers write their own code, not write the code for them.

 

I've already pointed you at code to download the XML from a URL.  You can use this KB article to learn how to parse the XML.

 

http://supportforums.blackberry.com/t5/Java-Development/Use-the-XML-Parser/ta-p/445210

 

You should have enough to get started writing your own code.

 

Good luck.

Please use plain text.
Contributor
sheetal2811
Posts: 21
Registered: ‎08-25-2011
My Carrier: developer

Re: live xml parsing source code

ok thakns can u pls send me test.xml also!!!!:Clover:

Please use plain text.
Contributor
sheetal2811
Posts: 21
Registered: ‎08-25-2011
My Carrier: developer

Re: live xml parsing source code

i tried your code but it gives this warning

 

 Warning!: Invocation of questionable method: java.lang.String.<init>() found in: mypackage.MyScreen$Connection.run()

Please use plain text.
Developer
peter_strange
Posts: 17,713
Registered: ‎07-14-2008

Re: live xml parsing source code

"can u pls send me test.xml also"  What are you asking for here? 

 

"i tried your code ..."  I don't think there is any of my code in any of the links I have given you. 

 

That said, I would not worry about that warning. 

 

 

Please use plain text.
Contributor
sheetal2811
Posts: 21
Registered: ‎08-25-2011
My Carrier: developer

Re: live xml parsing source code

m just asking for xml file which is using in your eample

named as   test.xml

Please use plain text.
Developer
peter_strange
Posts: 17,713
Registered: ‎07-14-2008

Re: live xml parsing source code

Ah I see.  You know I haven't looked at the sample in a while and it seems they have changed it (or my memory has gone) and previously it used a local XML file.  I haven't even realised it did network I/O!

 

You should replace the URL:

http://localhost:8000/content/test.xml

with your own URL

 

Please use plain text.
Contributor
sheetal2811
Posts: 21
Registered: ‎08-25-2011
My Carrier: developer

Re: live xml parsing source code

hi....

any body know that how to access video and image which is define in xml tag as url....

Please use plain text.