   How can I read a text file with j2me?
  hi!i want to read data from a text file into my app. i haven''t found such a class like randomaccessfile in j2se. or is the only way to read image files and wave files which are stored in the res folder?thanxalex 
  Hi!You can read any resource files stored within your jar.Just use the Stream classes in j2me (InputStream, DataInputStream,...).You can get a resource input stream by using the following code:InputStream is = this.getClass().getResourceAsStream("/ini.txt");where "this" is your MIDlet class and "ini.txt" the file you have added to your resource.McMc;  thanx a lot!i suggested that it should be possible with the resource files, but i am a newbie in java and the j2me. i am coming from c++ and it''s not really difficulty to get into java. some things like garbage collection and no pointers are different to c++, but nothing to get crazy about...thanx 4 your help. the most important differences are in the apis, where you have the first times to search for the right classes and methods.alex ;  You can also wrap your text in a dummy class like:public class Textfile {  public String theText = "This is my text file. " +  "I need to use \u1357 type escapes for Unicode characters," +  "and some other form of escape for newlines - \\015 should" +  "work. Let me try it... \015\015 Yay.";}   (Remember that the Java compiler interprets Unicode escapes before parsing for strings - since you can use them in variable names etc. too - so you can't use \u000D - it will break the string and make the compiler complain.)Of course, this will incur a couple hundred bytes of overhead, but if you want to have some structure in your text, or if you'd be loading pieces of it into an array *anyway*, this may be a better idea.   [edited by - Zahlman on February 17, 2004 4:00:46 PM];  if coming from a c++ background, java should be easier.no? 