[Android]Print

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

[Android]Print

Postby Lena » Mon Oct 23, 2017 4:15 am

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?
Lena
BCBJ Master
BCBJ Master
 
Posts: 525
Joined: Sun Feb 06, 2011 1:28 pm

Re: [Android]Print

Postby rlebeau » Mon Oct 23, 2017 11:25 am

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).
Last edited by rlebeau on Tue Oct 24, 2017 10:26 am, edited 1 time in total.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1457
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: [Android]Print

Postby Lena » Tue Oct 24, 2017 4:12 am

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.
Attachments
restoran.jpg
restoran.jpg (34.97 KiB) Viewed 657 times
Lena
BCBJ Master
BCBJ Master
 
Posts: 525
Joined: Sun Feb 06, 2011 1:28 pm

Re: [Android]Print

Postby rlebeau » Tue Oct 24, 2017 10:33 am

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.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1457
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: [Android]Print

Postby Lena » Wed Oct 25, 2017 4:05 am

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:
Lena
BCBJ Master
BCBJ Master
 
Posts: 525
Joined: Sun Feb 06, 2011 1:28 pm

Re: [Android]Print

Postby rlebeau » Wed Oct 25, 2017 11:05 am

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.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1457
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: [Android]Print

Postby Lena » Thu Oct 26, 2017 4:53 am

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. :!:
Lena
BCBJ Master
BCBJ Master
 
Posts: 525
Joined: Sun Feb 06, 2011 1:28 pm


Return to Technical

Who is online

Users browsing this forum: No registered users and 19 guests