J
Juls
Hi,
is there an easy way how one can write an image file from a J2ME
Midlet to the mobile phone's file system?
My attempts so far are not very promissing:
try {
byte[] imageByte = myVideoControler.getSnapshot(null);
FileConnection connection = (FileConnection) Connector
.open("file:///C:/cameraTest.png");
if (!connection.exists()) {
connection.create();
}
OutputStream os = connection.openOutputStream();
PrintStream ps = new PrintStream(os);
for (int i = 0; i<imageByte.length; i++){
ps.print(imageByte);
}
os.close();
connection.close();
ps.close();
} catch (MediaException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
I really hope you can give me a hint how solve this problem how I can
write an image file to the file system.
Cheers
Juls
is there an easy way how one can write an image file from a J2ME
Midlet to the mobile phone's file system?
My attempts so far are not very promissing:
try {
byte[] imageByte = myVideoControler.getSnapshot(null);
FileConnection connection = (FileConnection) Connector
.open("file:///C:/cameraTest.png");
if (!connection.exists()) {
connection.create();
}
OutputStream os = connection.openOutputStream();
PrintStream ps = new PrintStream(os);
for (int i = 0; i<imageByte.length; i++){
ps.print(imageByte);
}
os.close();
connection.close();
ps.close();
} catch (MediaException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
I really hope you can give me a hint how solve this problem how I can
write an image file to the file system.
Cheers
Juls