TSC Barcode Printer in Android

Usually every order made from POS system, need to print out the labels, so the shop can stick them on the meal or beverage, for them to deliver to the customers easily. TSC Barcode Printer is playing the important role helping on this.

Before writing any code, need to make sure what hardware module the TSC Printer you have. From there website, there are two model, one is basic only support ethernet, the other can support bluetooth model, but also need to plug on an adapter from USB to bluetooth. Mine is the TDP-225 basic one, so only can connect with ethernet.

TSC TDP-225 Model

To setup the TSC printer, make sure the power plugin and has turn on, and has put the printer paper roll inside in correct position.

There is TSC’s Diagnostic Tool can install on Window and adjust the printer setting properly.

You can download Android SDK on TSC download page, make sure put the tscsdk.jar in libs folder, and refresh the Android Studio.

During the print and test, it’s not easy to print at the position you want, so I design a TSCSetup object, let it setup width, height, and all position. And follow the demo code:

  1. Open Port.
  2. Setup.
  3. Clear buffer.
  4. Send the command.
  5. Print Label.
  6. Close Port.

Here is the log print in logcat for a single label:

I sticked them on the paper, the right hand side is the template, and the left one are print from Android App.

Like what you read? Give Soleil Software Studio, Inc. a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.