Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invoking HP ePrint Android application

Tags:

android

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

like image 581
milanmilyu Avatar asked Mar 28 '13 13:03

milanmilyu


People also ask

How do I connect my HP printer to ePrint app?

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.

What app do I need to print from my phone to my HP printer?

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.


1 Answers

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);

like image 51
milanmilyu Avatar answered Sep 30 '22 19:09

milanmilyu