java - Android how to print barcode from esc printer -


i manage print out barcode android apps ip thermal printer. in case can print out text printer , barcode image can't work. suggestion print out barcode esc thermal printer.

  public void print_bar_code(string content) {      byte[] formats = {(byte) 0x1d, (byte) 0x6b, (byte) 0x49};     byte[] contents = content.getbytes();      byte[] bytes = new byte[formats.length + contents.length + 1];      system.arraycopy(formats, 0, bytes, 0, formats.length);     system.arraycopy(contents, 0, bytes, formats.length, contents.length);      try {         writer.write(string.valueof(formats));         writer.write(string.valueof(contents));     } catch (ioexception e) {         e.printstacktrace();     } } 


Comments