本文整理汇总了Java中android.print.PrinterInfo类的典型用法代码示例。如果您正苦于以下问题:Java PrinterInfo类的具体用法?Java PrinterInfo怎么用?Java PrinterInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PrinterInfo类属于android.print包,在下文中一共展示了PrinterInfo类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onStartPrinterDiscovery
import android.print.PrinterInfo; //导入依赖的package包/类
@Override
public void onStartPrinterDiscovery(List<PrinterId> printers) {
Log.d(TAG, "onStartPrinterDiscovery()");
for (PrinterId id : printers) {
Log.d(TAG, "printerId:" + id.getLocalId());
}
List<PrinterInfo> addPrinters = new ArrayList<PrinterInfo>();
PrinterId printerId = mPrintService.generatePrinterId(PRINTER_ID);
PrinterInfo.Builder builder = new PrinterInfo.Builder(printerId,
"Dropbox Printer", PrinterInfo.STATUS_IDLE);
PrinterCapabilitiesInfo.Builder capBuilder =
new PrinterCapabilitiesInfo.Builder(printerId);
capBuilder.addMediaSize(PrintAttributes.MediaSize.ISO_A4, true);
capBuilder.addMediaSize(PrintAttributes.MediaSize.ISO_B5, false);
capBuilder.addResolution(new PrintAttributes.Resolution(
"Default", "default resolution", 600, 600), true);
capBuilder.setColorModes(PrintAttributes.COLOR_MODE_COLOR
| PrintAttributes.COLOR_MODE_MONOCHROME,
PrintAttributes.COLOR_MODE_COLOR);
builder.setCapabilities(capBuilder.build());
addPrinters.add(builder.build());
addPrinters(addPrinters);
}
示例2: ThermalPrinterDiscoverySession
import android.print.PrinterInfo; //导入依赖的package包/类
ThermalPrinterDiscoverySession(PrinterInfo printerInfo) {
PrinterCapabilitiesInfo capabilities =
new PrinterCapabilitiesInfo.Builder(printerInfo.getId())
.addMediaSize(PrintAttributes.MediaSize.ISO_A5, true)
.addResolution(new PrintAttributes.Resolution("1234","Default",200,200), true)
.setColorModes(PrintAttributes.COLOR_MODE_MONOCHROME, PrintAttributes.COLOR_MODE_MONOCHROME)
.build();
this.printerInfo = new PrinterInfo.Builder(printerInfo)
.setCapabilities(capabilities)
.build();
}
示例3: onCreate
import android.print.PrinterInfo; //导入依赖的package包/类
@Override
public void onCreate() {
mThermalPrinter = new PrinterInfo.Builder(generatePrinterId("Printer 1"),
"MiNiPrinter", PrinterInfo.STATUS_IDLE).build();
}
示例4: onStartPrinterDiscovery
import android.print.PrinterInfo; //导入依赖的package包/类
@Override
public void onStartPrinterDiscovery(List<PrinterId> priorityList) {
List<PrinterInfo> printers = new ArrayList<PrinterInfo>();
printers.add(printerInfo);
addPrinters(printers);
}