i have a question here.
I'm developing a mobile program using netbeans IDE. Because the application need to store data so i use FileReader. But when i code my application using FileReader's member function/variable, i have error. My IDE not able to find the symbol of FileReader.
The platform for my application is CDLC/MIDP.
I have import the Java.io.* in the beginning of the file.
My question is:
1. Can JDK1.5 library add in to the CDLC/MIDP platform? If can, can you show me how.
2. If not using FileReader, what other library that i can use to manage the data in a mobile application?
I have import the Java.io.* in the beginning of the file.
If you want to import the io package you need to import java.io.* and not Java.io.*. Java is case sensitive.
Having said that unless the java.io package is part of J2ME or is in one of the optional packages then you can't use it. I've never done any mobile work myself so have no idea but I guess you could just look in the API documentation for J2ME and see if it is there.
i have check my coding, my import is correct java.io.*
is was typing error in my previous post.
Dear themoffster and jitechno,
i have try the right click and left click.
1.When using the left click, the NB create a new FileReader class for me. which ask me to re-write the FileReader class all over again. i just want to use the class.
2.when using the right click, there was nothing i can do much. it just like a navigator.
you may refer to the attachment for more details.
How can i solve this problem? Do i need to create my own's FileReader?
Thanks.
1. Do you have this import?
import java.io.FileReader;
I see red error sign in yoour screen on a top of page, but I dont see code there. It is out of screen.
2. Delete you java.io import
and try again using clicks..
1.I have import the java.io.* at the top of my file.
one thing that i think i have did wrong is i did not install the j2 SDK SE v1.4.2
after i have install this SDK, the problem still remain. The NetBeans still said cannot find symbol.
here is the coding:
//at the top of the file
package SortScore;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*; //if i change this line to import java.io.FileReader
//the compiler will said cannot find symbol.
...
//anything related to FileReader is not recognize.
private void ReadFromTXT()
{
try
{
FileReader fro = new FileReader( "myFile.txt" );
BufferedReader bro = new BufferedReader( fro );
// declare String variable and prime the read
String stringRead = bro.readLine( );
while( stringFromFile != null ) // end of the file
{
System.out.println(stringFromFile);
stringFromFile = bro.readLine( ); // read next line
}
bro.close( );
}
catch( FileNotFoundException filenotfoundexxption )
{
System.out.println( "myFile.txt, does not exist" );
}
Thanks for asking.
actually i'm not sure what should i use to store my data.
From the internet, i saw:
1.Record Management System (RMS)
2.FileOutputStream
3.can use JDBC to run under the midlet application?
i'm not sure what to use. maybe you can show me what should i use.
Thanks.
hmm.. but it depends what kind of data, where and how you want keep.
I dont think JDBC is a right selection for mobile app.
FileOutputStream allows you keep data as files, at least.
About What kind of RMS are you talking?
about the RMS, This is what i get from the internet:
Record Management System Basics The Mobile Information Device Profile (MIDP) defines a set of classes for storing and retrieving data. These classes are called the Record Management System (RMS). With the RMS, it's possible to make data persist across invocations of a MIDlet. Different MIDlets in the same MIDlet suite can also use the RMS to share data...
yesterday, i have try to use the FileOutputstream but the netBeans give me a compile error saying "can not find symbol".
same as the problem i face in my first post (for "FileReader").
i have search the internet and found the java.io.* have a lot of function. This include the
1.FileReader
2.FileStream and etc.
but my java.io.* only have very few function. maybe you can have a look at the printscreen.
Is that the function that can support when we use the "Java wireless toolkit WTK2.5.2 for CDL"?
Means java.io.* only have the very basic function in platform "Java wireless toolkit WTK2.5.2 for CDL".
When you develop a true java application, then you can get to access to all the java.io.* function,which is more that the mobility platform?
thanks.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.