04-10-2009, 08:04 PM
|
#2 (permalink)
|
| BlackBerry Extraordinaire
Join Date: Mar 2008 Location: Austin, TX Model: 9700 PIN: N/A Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0 Thanked 34 Times in 33 Posts
| Add the file to your project.
Use Class.forName() like this (modify for your package structure):
// get the data
Class cl = Class.forName("com.foo.Foobar.Foobar");
...then create an input stream:
// URL is in the form /text.xml
InputStream stream = cl.getResourceAsStream( getURL() );
dataInputStream = new DataInputStream(stream); |
| Offline
| |