Page 1 of 1

[Android]Print

PostPosted: Mon Oct 23, 2017 4:15 am
by Lena
Hi.
I want to send the contents of Memo1 to print. How to implement this?
Can this be done without printer dialogs? The user pressed the button in the application and printed the contents of Memo1.
Maybe I need to implement a separate Indy print server on a stationary computer? Then send data from Android with IndyTCP...
Can print without a server for Android?

Re: [Android]Print

PostPosted: Mon Oct 23, 2017 11:25 am
by rlebeau
Android devices can output directly to a printer if they have appropriate software installed to facilitate that.

Everything You Need to Know About Printing From Your Android Phone or Tablet

I have printers from Brother and Canon, and they both have print services to allow me to print from Android apps.

As for actually sending something to a printer, see Printing Content in Android's documentation, in particular Printing Custom Documents (the APIs can be accessed using Embarcadero's JNI Bridge framework).

Re: [Android]Print

PostPosted: Tue Oct 24, 2017 4:12 am
by Lena
Hi.
A tablet with a menu and FMX application will stand in the restaurant. The user selects dishes and presses the button. The printer should print a check without dialog boxes. See the picture. A restaurant visitor should not see dialog window.
I found this article, but it does not say how to remove dialog boxes:
Printing from an Android device using FireMonkey
Whether it will be correct to make so?:
1. Put in the restaurant kitchen a computer with Windows and a printer.
2. Add the TIdTCPClient in FMX application to Android.
3. For a Windows computer in the kitchen, make a VCL application with TIdTCPServer.
4. From the Android application on the visitor's table send the Memo1 contents to the Windows computer and in the IdTCPServer.OnExecute event do the printing check in the kitchen.
Is this correct and how would You accomplish such a task?
Thank You.

Re: [Android]Print

PostPosted: Tue Oct 24, 2017 10:33 am
by rlebeau
Lena wrote:how would You accomplish such a task?


NOT with a TCP client/server solution, that's for sure.

Did you read the Android articles I pointed you to? Printing HTML Documents and Printing Custom Documents are what you are looking for. Don't use Embarcadero's Share action described in Printing from an Android device using FireMonkey, it is not flexible enough for your needs.

Re: [Android]Print

PostPosted: Wed Oct 25, 2017 4:05 am
by Lena
NOT with a TCP client/server solution, that's for sure.


I did it with Indy. Indy proved to be very convenient and good for such a task. Indy is an excellent tool.
I do not know yet how this will work in real conditions.

Did you read the Android articles I pointed you to?


I sometimes can not understand how to translate the code from pascal to c++ and even more so the language of java is a problem for me. :cry:

Re: [Android]Print

PostPosted: Wed Oct 25, 2017 11:05 am
by rlebeau
Lena wrote:I sometimes can not understand how to translate the code from pascal to c++ and even more so the language of java is a problem for me. :cry:


That does not mean it is not the right tool to use, though. Android is a Java-based OS (well, Java on top of Linux, but that is besides the point), so you should learn to understand how its Java-based APIs work if you are going to be an effective Android developer.

Re: [Android]Print

PostPosted: Thu Oct 26, 2017 4:53 am
by Lena
Yes you are right.
But programming is not my main task. I'm programming from time to time at the request of my friends. For example, now I'm making an application for a friend of the restaurant owner. I do not get paid for it.
At one time I read a couple of books about C++ Builder and I like it.
I only know a little bit of C++ Builder.
The basic information I take from this forum, dokiwiki and forum FMX: http://fire-monkey.ru
I have nowhere found the information how to directly print for Android on C++ Builder.
So I chose Indy because I had an experience with Indy in the past and he was wonderful. :!: