Training Mag For most of the examples given in this tutorial yo | Page 7
Example 1/3
1. Single image file print
Intent intent = new Intent("com.sec.print.mobileprint.action.PRINT");
String rootSDCard = Environment.getExternalStorageDirectory().getAbsolutePath();
Uri uri = Uri.parse(rootSDCard + "/Test.jpg");
intent.putExtra("com.sec.print.mobileprint.extra.CONTENT", uri );
intent.putExtra("com.sec.print.mobileprint.extra.CONTENT_TYPE", "PHOTO");
intent.putExtra("com.sec.print.mobileprint.extra.OPTION_TYPE", "PHOTO_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.
2. Multiple image files print
Intent intent = new Intent("com.sec.print.mobileprint.action.PRINT");
String rootSDCard = Environment.getExternalStorageDirectory().getAbsolutePath();
ArrayList arrayContents = new ArrayList();
arrayContents.add(Uri.parse(rootSDCard + “/Page1.jpg”);
arrayContents.add(Uri.parse(rootSDCard + “/Page2.jpg”);
arrayContents.add(Uri.parse(rootSDCard + “/Page3.jpg”);
intent.putExtra("com.sec.print.mobileprint.extra.MULTIPLE_CONTENTS", arrayContents );
intent.putExtra("com.sec.print.mobileprint.extra.CONTENT_TYPE", “PHOTO");
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.
7