Hellow,
Anybody know how to print a image via bluetooth??
I try to do this, but isn´t work:
//code----------------------------------------------------------------------------------------------------
try {
//reed the image from a file, and saved in a byte array (img)
FileConnection fc=(FileConnection)Connector.open("file:///E:/Extra/imagen.jpg",Connector.READ_WRITE);
InputStream is=fc.openInputStream();
byte img[]=new byte[(int)fc.fileSize()];
is.read(img);
is.close();
fc.close();
//do a bluetooth connection
StreamConnection btcon;
btcon =(StreamConnection)Connector.open("btspp://00158336E722:1;master=false;encrypt=false;authenticate=false");
OutputStream output = btcon.openOutputStream();
//send the image to the printer
output.write(img);
output.close();
btcon.close();
}catch(Exception e){System.err.println("error: " + e);}
//end code--------------------------------------------------------------------------------------------
For more information I use java Me, MIDP 2.0,Netbeans IDE, nokia 5130 and a printer Epson mp260.
I get the bluetooth adress from the printer.
please I need help.
thanks.

Reply With Quote


