I am working on a android project. One key requirement is to print receipt via a wifi-connected printer.
At this stage, what I have achieved is to open a printer dialog. Then the printer dialog allows user to interact to select a list of available printers and then tap print.
But I hope there is a way to avoid user interaction and directly print the content like html file, image etc.
this is the code for printing a bitmap image.
private void doPhotoPrint()
{
PrintHelper photoPrinter = new PrintHelper(this);
photoPrinter.setScaleMode(PrintHelper.SCALE_MODE_FIT);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.coffeehost);
photoPrinter.printBitmap("droids.jpg - test print", bitmap);
}
and the printer is Epson Artisan 730.
The code works but it pops up a print dialog and user have to select the Epson printer and then tap "print" button.
What I really want is to avoid that dialog and directly print the image.
For this project, I can decide what kind of printer to use as long as it supports direct printing.