I am working on an android app that should invoke android HP ePrint application for wireless printing. For that purpose, I'm using code:
Intent intent = new Intent("com.hp.android.print.PRINT"); intent.setPackage("com.hp.android.print"); startActivityForResult(intent, 0);
I am pretty sure that I didn't get intent's action right... Does anybody know what is the right action to invoke this HP ePrint application? And how can I pass the exact file to print (intent.putExtra(...)).
Thanks
Select the HP Web Services tab, and then select the Enable Web Services button. Select the Enable HP ePrint check box, and then select Apply. Locate the printer claim code on the HP Web Services tab. You will use the printer claim code to register the printer with HP Connected.
Set up your device for wireless printing by going to the Google Play Store and installing the HP Print Service plugin. Once installed, make sure it's toggled on and enabled for printing.
After more than 10 hours, I managed to find the solution. Right code to invoke HP ePrint application is like this:
Uri uri = Uri.fromFile( f ); Intent intent = new Intent ("org.androidprinting.intent.action.PRINT"); intent.setDataAndType( uri, "text/plain" ); context.startActivityForResult(intent, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With