【发布时间】:2018-07-18 17:32:06
【问题描述】:
我在 V7 POS 终端(打印模块)android 机器(V5.1.1)中工作。我已经在我的应用程序中配置了 SDK(Jar 文件)。服务器应用程序安装在 POS 机上。打印过程中出现问题。在这里,我已经包括了我的步骤。我被困在这个问题上超过一天。帮我修一下。
服务已启动。
public void startService(){
Intent intent = new Intent();
intent.setAction("com.justtide.service.dev.AIDL_SERVICE");
intent.setPackage("com.justtide.service.dev");
bindService(intent, mConnection, Service.BIND_AUTO_CREATE);
}
设备提供商
private ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceDisconnected(ComponentName name) {
}
@Override
public synchronized void onServiceConnected(ComponentName name, IBinder service) {
// TODO Auto-generated method stub
mDeviceProvider = DeviceProvider.Stub.asInterface(service);
}
};
打印机供应商
printerProvider =mDeviceProvider.getPrinterProvider();
printerProvider.fillStringFormat("TEST",PRINTER_FONT_SIZE_SMALL,PRINTER_FONT_TYPE_BOLD,PRINTER_ALIGNMENT_CENTER);
printerProvider.fillString("001420183990573");
int ret=-1;
try{
ret = printerProvider.print(); // The Problem is occurred here.
} catch (RemoteException e) {
e.printStackTrace();
}
这里我已将我的错误日志包含在 POS 机中。
错误选择的应用程序
com.example.justtidev7_demo I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@3e9ea6fc time:3027349
com.example.justtidev7_demo W/System.err: android.os.DeadObjectException
com.example.justtidev7_demo W/System.err: at android.os.BinderProxy.transactNative(Native Method)
com.example.justtidev7_demo W/System.err: at android.os.BinderProxy.transact(Binder.java:496)
com.example.justtidev7_demo W/System.err: at com.justtide.service.dev.aidl.printer.PrinterProvider$Stub$Proxy.print(PrinterProvider.java:274)
com.example.justtidev7_demo W/System.err: at
com.justtide.dao.Printer.print(Printer.java:34)
com.example.justtidev7_demo W/System.err: at
com.justtide.activity.PrintActivity$3.run(PrintActivity.java:111)
com.example.justtidev7_demo W/System.err: at java.lang.Thread.run(Thread.java:818)
错误无过滤器
JustD: jdc_connect ...
02-08 15:36:51.577 15261-15276/? E/JavaBinder: *** Uncaught remote
exception! (Exceptions are not yet supported across processes.)
java.lang.NoSuchMethodError: No virtual method printerOpen()I in class
Lcom/just/api/PosDevice; or its super classes (declaration of
'com.just.api.PosDevice' appears in
/system/framework/framework.jar:classes2.dex) at
com.justtide.justtide.aq.d(Unknown Source) at justtide.PrintPicture.startPrint(Unknown Source) at com.justtide.service.dev.i.print(Unknown Source) at com.justtide.service.dev.aidl.printer.PrinterProvider$Stub.onTransact(Unknown Source) at android.os.Binder.execTransact(Binder.java:446)
02-08 15:36:51.577 15261-15276/? E/AndroidRuntime: FATAL EXCEPTION: Binder_1
Process: com.justtide.service.dev, PID: 15261
java.lang.NoSuchMethodError: No virtual method printerOpen()I in class Lcom/just/api/PosDevice; or its super classes (declaration of 'com.just.api.PosDevice' appears in /system/framework/framework.jar:classes2.dex)
at com.justtide.justtide.aq.d(Unknown Source)
at justtide.PrintPicture.startPrint(Unknown Source)
at com.justtide.service.dev.i.print(Unknown Source)
at com.justtide.service.dev.aidl.printer.PrinterProvider$Stub.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:446)
【问题讨论】:
标签: java android thermal-printer printer-control-language