3

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.

W.K.S
  • 9,787
  • 15
  • 75
  • 122

1 Answers1

7

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);
peter_the_oak
  • 3,529
  • 3
  • 23
  • 37
W.K.S
  • 9,787
  • 15
  • 75
  • 122
  • Can you please provide the link where you have found above details? – Jaiprakash Soni May 20 '14 at 04:54
  • If you're printing local HTML file, make sure to write your URI as "file:///pathtoyourfile/yourfile.html", otherwise Samsung Mobile Print will open your path as Google query. – Dino Velić Feb 10 '15 at 09:06
  • 3
    Found [Calling Samsung Mobile Print Via Intent](http://developer.samsung.com/forum/board/thread/file.do?attachmentId=17452) – Jon Oct 01 '15 at 20:19