Reputation: 10095
I'm developing an Android application and I want to print an HTML page via the Samsung Mobile Print app. What are the intent parameters that I need to do this i.e.
package name
MIME type
Action type (ACTION_SEND
, ACTION_VIEW
e.t.c)
any other parameters that are required.
Is there a way I can find out these parameters? I managed to find out the package name using adb shell but when I tried to pass the HTML page as a bundle, it throw an ActivityNotFoundException (No Activity found to handle ACTION_SEND)
.
I know there are other options for printing such as PrinterShare Pro and Gooble Cloud Print but I'm developing this application for a client and so I have to communicate with the Samsung Mobile Print app.
Thanks for your help.
Upvotes: 3
Views: 5301
Reputation: 10095
I contacted the developers of the Samsung Mobile Print app and they provided the following code:
Intent intent = new Intent("com.sec.print.mobileprint.action.PRINT");
Uri uri = Uri.parse("http://www.samsung.com");
intent.putExtra("com.sec.print.mobileprint.extra.CONTENT", uri );
intent.putExtra("com.sec.print.mobileprint.extra.CONTENT_TYPE", "WEBPAGE");
intent.putExtra("com.sec.print.mobileprint.extra.OPTION_TYPE", "DOCUMENT_PRINT");
intent.putExtra("com.sec.print.mobileprint.extra.JOB_NAME", "Untitled");
startActivity(intent);
Upvotes: 7