Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


how to print a image via bluetooth using java me?

Posted on 2010-01-04
Medium Priority
Last Modified: 2013-12-14
hello experts,

Anybody know how to print a image via bluetooth?

I try with this code, but isn´t works, if anybody knows what is wrong in this code or other form to do this, please tell me. I took the printer bluetooth adress directly from the printer.

I use java me MIDP 2.0, cellphone Nokia 5130 and a printer Epson pm 260.

The printer only acept images in JPG and TIFF format
//I try this, but isn´t work

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()];


//do a bluetooth connection
StreamConnection btcon;
btcon =(StreamConnection)Connector.open("btspp://00158336E722;master=false;encrypt=false;authenticate=false");

OutputStream output = btcon.openOutputStream();

//send the image to the printer


}catch(Exception e){System.err.println("error: " + e);}

Open in new window

Question by:Dermofit

Accepted Solution

prasmin earned 2000 total points
ID: 26370829
Dear Dermofit,

I would like to know are you discovering the device and are you able to print the text to printer. I suppose looking at the piece of routine you must be discovering the device if not please do it. Further, if you are able to print the text and image is not being printed, I suppose it problem with the Image file.

Let me know as I am also working on the similar project.


Prasmin Mehta

Author Comment

ID: 26388440
Thanks for you input Prasmin. It seems that for the moment our project will not be using bluetooh. Thanks, for your time though.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
This program is used to assist in finding and resolving common problems with wireless connections.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month10 days, 2 hours left to enroll

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question