PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → Printing over android
Printing over android
Started by Mister TRIANTAFILLOS, Feb., 14 2018 6:47 PM - 1 reply
Registered member
30 messages
Posted on February, 14 2018 - 6:47 PM
Any suggestions for print in thermal network printer over android ?
(I don't wont to use web services with pc for printing data as client of web services, this is the only way to printing for know).
Registered member
30 messages
Posted on February, 15 2018 - 7:07 PM
Hear is one code to print a text fille that export my app and send to 3rd part application "PrintBot" to handle the printig

Path is UNICODE string =(CompleteDir(SysDirStorageCard()) + "document.txt")
textto_print is UNICODE string
textto_print= "Export text + printbot line 1" + CR
textto_print= textto_print + "line 2"
fSaveText(Path,textto_print)
Call_print_bot(Path)



/*Java code*/
import android.net.Uri;
import java.io.File;
import android.content.Intent;
import android.content.Context;
import android.app.Activity;
import java.lang.*;
import android.util.*;
import java.lang.Exception;
import android.util.Log;

public static void Call_print_bot(String path_tmp)
{

    /* https://www.zenofx.com*/
Intent intent = new Intent("com.zenofx.action.PRINT");
File path_ToPrint  = new  File(path_tmp.toString());
Uri uriToPrint = Uri.fromFile(path_ToPrint);
intent.setDataAndType(uriToPrint, "text/html");
getCurrentActivity().startActivity(intent);
/*Toast.makeText(getApplicationContext(),  uriToPrint.toString() ,Toast.LENGTH_LONG).show();*/
}



How can i use the google cloud printer ?
after some searching i found have some code that can print using java classes etc and i dont know how to define java classes over windev mobile. (code that i found its for Android studio). I whone this solution to do not need the 3rd part app
Message modified, February, 15 2018 - 7:09 PM