Android Question Android - Bluetooth - TSC

Tico.13

Member
Hi, could someone help me out translating this TSC Printers android example to B4A:

Android Example for TSC Bluetooth

import com.example.tscdll.TSCActivity;

public class MainActivity extends Activity {
TSCActivity TscDll = new TSCActivity();

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

TscDll.openport("00:19:0E:A0:04:E1");
TscDll.downloadpcx("UL.PCX");
TscDll.downloadbmp("Triangle.bmp");
TscDll.downloadttf("ARIAL.TTF");
TscDll.setup(70, 110, 4, 4, 0, 0, 0);
TscDll.clearbuffer();
TscDll.sendcommand("SET TEAR ON\n");
TscDll.sendcommand("SET COUNTER @1 1\n");
TscDll.sendcommand("@1 = \"0001\"\n");
TscDll.sendcommand("TEXT 100,300,\"3\",0,1,1,@1\n");
TscDll.sendcommand("PUTPCX 100,300,\"UL.PCX\"\n");
TscDll.sendcommand("PUTBMP 100,520,\"Triangle.bmp\"\n");
TscDll.sendcommand("TEXT 100,760,\"ARIAL.TTF\",0,15,15,\"THIS IS ARIAL FONT\"\n");
TscDll.barcode(100, 100, "128", 100, 1, 0, 3, 3, "123456789");
TscDll.printerfont(100, 250, "3", 0, 1, 1, "987654321");
String status = TscDll.printerstatus();
text1.setText(status);
TscDll.printlabel(2, 1);
//TscDll.sendfile("zpl.txt");
TscDll.closeport(5000);
}
}
 
Top