Reputation: 43
How to bypass printer dialog box in android application ? I have already tried the PRINTER API from android but it prompts me a preview box Checked many things then found it is possible through google cloud print but not sure if anyone an confirm and guide the same. Will be really greatful thanks in advance
Upvotes: 4
Views: 2081
Reputation: 1124
https://github.com/gmuth/ipp-client-kotlin can silently submit documents compatible with the printer via the ipp network protocol. The library does not render PDF, so you need a rendering component if your printer or print server does not support the document-format you would like to be printed.
Upvotes: 0
Reputation: 600
As far as I know, the documentation on https://developers.google.com/cloud-print/docs/android explains two possible options to integrate GCP functionality in your app:
Using the Android.Print API will always result in a call to the OS Print Dialog, where you will be prompted to select the printer from the list and the print settings. In this case, the list of printers is provided by the different print services the user has installed in their device, and Google Cloud Print is one of them.
Having said that, there's still a way to achieve what you call silent print. You may need to implement the Google Cloud Print API calls in your own application. I've done it as part of a Java applicatio, so it won't be very different in Android.It requires 2 things:
You'll find all the required info on https://developers.google.com/cloud-print/docs/appInterfaces
More information on OAuth 2.0 to access Google APIs on https://developers.google.com/identity/protocols/OAuth2
Upvotes: 1