Canned Responses?
I want to use the I/O library routines for development -- primarily the File reading and writing classes. However, they are not including with the KVM distribution. So I decided to try importing them into a different library and including their dependent files along with them. When I compiled them, all went well, but when I ran them, I got an error about one of the native methods. Here's the code for the call:
MyPackage.BufferedReader bfe =null;
if (debug) System.out.print("Opening file... ");
try{
bfe =new MyPackage.BufferedReader(new MyPackage.FileReader("file.txt"));
catch (FileNotFoundException fnfe){
System.out.println("File not found. Using defaults");
}
//Rest of code
The code runs up to the line where the reader is defined (new MyPackage.....) and it fails with the error message:
Opening file... ALERT: Native method'MyPackage/FileInputStream::initIDs' not found.
Execution completed successfully
{Other technical stuff}
Is there a way in which I can use the File I/O classes because at the moment, I'm typing in all the data by hand each and every time I run my MIDlet which is not good for my fingers. And I don't want to hard code it into the MIDlet because that means I need to recompile each time I want to change the data and changing a file is much easier than changing the source code and recompiling.
(BTW: I've tried many different workarounds for this problem, but each one fails.)
Thanks in advance for any help.
PS: I know the KVM was designed for low-spec constrained machines, but I was just wondering if there is any way I can prevent my hands from contracting RSI before I finish this program... ;-)
Johnny

