title: Print QR code on zebra printer from android
body: <p>i have Zebra MZ 220 printer, and i need to print the QR code from my android app via bluetooth. I am able to print text and images but not QR code.</p>
  
  <p>I found this: <a href="https://km.zebra.com/kb/index?page=content&amp;id=SO7133&amp;actp=LIST_POPULAR" rel="noreferrer">https://km.zebra.com/kb/index?page=content&amp;id=SO7133&amp;actp=LIST_POPULAR</a></p>
  
  <p>So, here's my code:</p>
  
  <pre><code>new Thread(new Runnable() {
  public void run() {
      try {
  
          // Instantiate connection for given Bluetooth® MAC Address.
          ZebraPrinterConnection thePrinterConn = new BluetoothPrinterConnection("XX:XX:XX:XX:XX:XX");
  
          // Initialize 
          Looper.prepare();
  
          // Open the connection - physical connection is established here.
          thePrinterConn.open();
  
  
  
          // SO THIS SHOULD PRINT THE QR CODE BUT DOESN'T :(
          thePrinterConn.write("! 0 200 200 500 1\r\nB QR 10 100 M 2 U 10\r\nMA,QR code ABC123\r\nENDQR\r\nFORM\r\nPRINT".getBytes());
  
  
  
          //Make sure the data got to the printer before closing the connection
          Thread.sleep(500);
  
          // Close the connection to release resources.
          thePrinterConn.close();
  
          Looper.myLooper().quit();
  
      } catch (Exception e) {
          // Handle communications error here
          e.printStackTrace();
      }
  }
  }).start();
  </code></pre>
  
  <p>it dosen't work. So .... any help is appreciated :)</p>