Training Mag For most of the examples given in this tutorial yo | Page 8
Example 2/3
3. Document file print
Intent intent = new Intent("com.sec.print.mobileprint.action.PRINT");
String rootSDCard = Environment.getExternalStorageDirectory().getAbsolutePath();
Uri uri = Uri.parse(rootSDCard + "/Test_document.pdf");
intent.putExtra("com.sec.print.mobileprint.extra.CONTENT", uri );
intent.putExtra("com.sec.print.mobileprint.extra.CONTENT_TYPE", “DOCUMENT");
intent.putExtra("com.sec.print.mobileprint.extra.OPTION_TYPE", “DOCUMENT_PRINT");
intent.putExtra("com.sec.print.mobileprint.extra.JOB_NAME", "Untitled");
startActivity(intent); // Starts Mobile Print
//startActivityForResult(intent , 99) // Use this if you want to get result that user pressed Print or just returned
back from Mobile Print.
4. Web URL print
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); // Starts Mobile Print
//startActivityForResult(intent , 99) // Use this if you want to get result that user pressed Print or just returned
back from Mobile Print.
8