| | |
Write File in J2ME
![]() |
•
•
Join Date: Feb 2007
Posts: 21
Reputation:
Solved Threads: 0
Hai Friends,
Iam using J2ME , i can read a text file from jar (in res folder) by using
InputStream is = getClass().getResourceAsStream("help.txt");
StringBuffer sb = new StringBuffer();
try{
int chars, i = 0;
while ((chars = is.read()) != -1){
sb.append((char) chars);
}
return sb.toString();
}catch (Exception e){}
but i want write a data to the text file, i doknow how to write please any one help me for this problem.
Iam using J2ME , i can read a text file from jar (in res folder) by using
InputStream is = getClass().getResourceAsStream("help.txt");
StringBuffer sb = new StringBuffer();
try{
int chars, i = 0;
while ((chars = is.read()) != -1){
sb.append((char) chars);
}
return sb.toString();
}catch (Exception e){}
but i want write a data to the text file, i doknow how to write please any one help me for this problem.
Writing to file in JAR archive is not possible, only reading is allowed. I'm not sure what you are doing, as what you trying to write/store, but you have generally two options
- Record Management System - RMS that is essentially mini database
- PDA Optional Packages is JSR 75 that late you use FileConnection object, but this is often used for remote access (URL/OBEX/Bluetooth)
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- J2ME - C# Image Exchange (Java)
- Can I do System Programming with Java (Java)
- Write Your First Application in Win32 Using Assembly (Assembly)
- J2me (Java)
- How to send text to a text file using j2me through http connection? (Java)
Other Threads in the Java Forum
- Previous Thread: I need serious help. its urgent.
- Next Thread: Saving swing design..
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary blackberry block bluetooth character chat class client code component consumer csv database desktop developmenthelp eclipse error fractal ftp game givemetehcodez graphics gui html ide image integer j2me j2seprojects japplet java javaarraylist javac javaee javaprojects jni jpanel julia lego linked linux list loops mac map method methods mobile netbeans newbie number objects online oriented panel printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server set singleton sms sort sql string swing test textfields threads time title tree tutorial-sample ubuntu update windows working






