BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-04-2005, 06:52 AM   #1
phobeous
Knows Where the Search Button Is
 
Join Date: Jan 2005
Location: Spain
Model: 7230
Carrier: Movistar
Posts: 19
Default Get XML InputStream from .cod file

Please Login to Remove!

Hi everyone, I'm developing an application in which I've to read a xml file (it describes a tree-menu). For that issue I just added the xml file to the project and parsed it with Kxml, using .getResourceAsStream(...) inside my custom parser method. Everything works fine if I use no packages (usually when I'm testing). When I decided to use packages, I moved the xml file to the same directory as my parser class and the file just can't be read.

This has sense because the intermediate .jar file doesn't associate the path to resources files (such as images and my xml file).

The first solution is go backward and refuse packages but I want to use packages, so the answer is: does anyone got the same problem as me? If so: how did you solve?. Maybe this could be done with access to the contents of the cod file. Is this last possible?

Thanks in advance for any feedback.

Greetz from Spain!!

P.S.: Sorry for my English.
Offline  
Old 02-04-2005, 07:51 AM   #2
phobeous
Knows Where the Search Button Is
 
Join Date: Jan 2005
Location: Spain
Model: 7230
Carrier: Movistar
Posts: 19
Default Auto-answer

Just added the full-qualified name of the class:

Code:
parser.setInputxxx40;new InputStreamReaderxxx40;Class.forNamexxx40;"com.company.ClassName"xxx41;.getResourceAsStreamxxx40;"/file.xml"xxx41;xxx41;xxx41;;
Really works.
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh picture

Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh

$219.95



Nice Vintage Working RIM Blackberry 857, with Cradle, Collector's Item R857D-2-5 picture

Nice Vintage Working RIM Blackberry 857, with Cradle, Collector's Item R857D-2-5

$124.95



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL

$118.19



Little Trees 67343 Blackberry Clove Hanging Air Freshener for Car/Home 6 Pack picture

Little Trees 67343 Blackberry Clove Hanging Air Freshener for Car/Home 6 Pack

$8.99



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL

$118.19



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL

$118.19







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.