Arjun saini
Arjun saini

Reputation: 4182

I am trying to print wireless for label printer QL-720NW but I am gettting ERROR_NOT_MATCH_ADDRESS?

The Code I am using .

I am print the error code on textview.This is given the ERROR_NOT_MATCH ADDRESS. I am using the this by some links and with brother Sdk.

The Links I am using this By Link using

 public class printerApp extends Activity {
 TextView mytext;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mytext=(TextView)findViewById(R.id.mytext);


        printTemplateSample();
    }
    public void printTemplateSample() {

        Printer myPrinter = new Printer();
        PrinterInfo myPrinterInfo = new PrinterInfo();
        PrinterStatus printResult = new PrinterStatus();
        LabelInfo mLabelInfo=new LabelInfo();
        try{

            myPrinterInfo = myPrinter.getPrinterInfo();
            myPrinterInfo.ipAddress="192.168.0.122";
            myPrinterInfo.macAddress="00:80:92:d7:f4:0d";
            myPrinterInfo.printerModel= PrinterInfo.Model.QL_720NW;
            myPrinterInfo.printMode= PrinterInfo.PrintMode.FIT_TO_PAGE;
            myPrinterInfo.port= PrinterInfo.Port.NET;
            myPrinterInfo.paperPosition= PrinterInfo.Align.CENTER;

           myPrinterInfo.paperSize = PrinterInfo.PaperSize.CUSTOM;
            myPrinterInfo.orientation = PrinterInfo.Orientation.PORTRAIT;
            myPrinterInfo.halftone = PrinterInfo.Halftone.PATTERNDITHER;
            myPrinterInfo.align = PrinterInfo.Align.LEFT;
            myPrinterInfo.margin.left = 0;
            myPrinterInfo.valign = PrinterInfo.VAlign.TOP;
            myPrinterInfo.customPaperLength = 0;
            myPrinterInfo.customPaperWidth = 0;
            myPrinterInfo.customFeed = 0;
            myPrinterInfo.paperPosition = PrinterInfo.Align.CENTER;
            myPrinterInfo.dashLine = false;
          //  myPrinterInfo.isSpecialTape=
            myPrinterInfo.numberOfCopies = 1;


            myPrinterInfo.labelNameIndex= 15;
            myPrinterInfo.isAutoCut = false;
            myPrinterInfo.isCutAtEnd =false;
          //  myPrinter.setLabelInfo(mLabelInfo);
            myPrinter.setPrinterInfo(myPrinterInfo);
            //myPrinter.setPrinterInfo(myPrinterInfo);


            // Create bitmap
            Bitmap bmap = BitmapFactory.decodeResource(getResources(), R.mipmap.dcs);

            try {
                mytext.append("Start" + "\n");

                myPrinter.startCommunication();
                PrinterStatus printerStatus = myPrinter.printImage(bmap);

                myPrinter.endCommunication();

                mytext.append(printerStatus.errorCode.toString() + "\n");

            } catch (Exception e) {
                mytext.setText(e.toString());
            }

        } catch (Exception e) {
            mytext.setText(e.toString());
            //e.printStackTrace();
        }
    }
    }

I am print an image from resources folder also I am trying this to print the text also. but every time I am getting this error which is showing above

thanks in advance to all viewers please help me.....

Upvotes: 2

Views: 450

Answers (1)

Arjun saini
Arjun saini

Reputation: 4182

I solved this By integrate The Sdk demo in my Code... Sdk download with sample demo

for all brother printer

  • I set the all preference in my code which printer need.

Upvotes: 1

Related Questions