Try all forms that appear in the forum and I can not make an impression out. The bluetooth printer connects perfectly, and does not jump me no error in the app, but nothing comes out.
B4X:
Sub Process_Globals
Dim Serial As Serial
Dim printer As TextWriter
Dim Mac As String = "00:01:90:D6:61:CC"
Dim TxtPrueba As String = "Texto de prueba"
End Sub
Sub Globals
Dim Imprimir As Button
Dim btAdmin As BluetoothAdmin
Dim btnConectar As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Impresora")
If FirstTime Then
btAdmin.Initialize("BlueTeeth")
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub BtnConectar_Click
Serial.Initialize (Serial)
If Serial.IsEnabled Then
ToastMessageShow("Serial inicializado", False)
Serial.Connect(Mac)
ToastMessageShow("Conectado a la impresora",False)
End If
End Sub
Sub Imprimir_Click
Serial.Initialize("Printer")
printer.Initialize(Serial.OutputStream)
Msgbox(Serial.OutputStream , "")
printer.WriteLine (TxtPrueba)
printer.WriteLine("segunda linea")
printer.Flush
printer.Write("Soreta")
printer.Flush
Msgbox("Impresion desconectada","")
printer.Close
End Sub
Last edited: