java – NFC Print from Android app-ThrowExceptions

Exception or error:

I have been doing alot of research today, about whether or not it’s possible to implement NFC printing in an Android app. We have a client who has an HP printer with the NFC feature, and want to use that in an app we created earlier, instead of Cloud printing. What we want is, to be able to set some options regarding the print itself, like orientation and scale etc., automatically, so we can just hold our Android device in front of the printer.

Use case:

  1. Press print button in Android app
  2. Create bitmap
  3. Show dialog saying: “Hold phone close to the printers NFC reader”
  4. The printer then prints the bitmap, without further user interaction.

The idea here is, as mentioned above, that we can se some print options in the NFC message.

Have anyone done anything like this before, and is it even possible to use a custom implementation of NFC printing on Android yet?

Another solution would be to use HP’s own feature, called EPrint. I have created a test version, where we just create the bitmap and then create an intent to the EPrint application (the user must have the HP EPrint app installed…).

The EPrint app then finds the right printer, by itself, and then the user must set some printing options before pressing “print”. It doesnt seem like it’s possible to adjust any printer options with the intent (bundle), but maybe it just lacks documentation?

The above implementation is not too bad, because the client doesn’t mind having the HP EPrint app installed. But the NFC feature would be more preferable.

Is any of this possible?

How to solve:

It appears that the hp EPrint app supports nfc printing without option selection. This video demonstrates how to print through EPrint using nfc. If you export the document to the app, it will show preview mode. When the preview is shown, you simply place the phone on the printer’s nfc chip and it should automatically print with no additional options or dialogue.

Leave a Reply

Your email address will not be published. Required fields are marked *