指纹应用程序中 SecuGEN SDK 的 NULL 异常

NULL Exception on SecuGEN SDK in Fingerprint Application

关于 resume 方法,我有以下代码:

try{
    sgfplib.GetUsbManager().requestPermission(usbDevice, mPermissionIntent);
    error = sgfplib.OpenDevice(0);
    debugMessage("OpenDevice() ret: " + error + "\n" );
    SecuGen.FDxSDKPro.SGDeviceInfoParam deviceInfo = new SecuGen.FDxSDKPro.SGDeviceInfoParam();
    error = sgfplib.GetDeviceInfo(deviceInfo);
    Toast.makeText(this, "Size is  "+ mMaxTemplateSize[0], Toast.LENGTH_LONG).show();
    debugMessage("GetDeviceInfo() ret: " + error + "\n");
    mImageWidth = deviceInfo.imageWidth;

    Toast.makeText(this, "mImageWidth is  "+ mImageWidth, Toast.LENGTH_LONG).show();
    mImageHeight= deviceInfo.imageHeight;

    Toast.makeText(this, "mImageHeight is  "+ mImageHeight , Toast.LENGTH_LONG).show();
    sgfplib.SetTemplateFormat(SGFDxTemplateFormat.TEMPLATE_FORMAT_SG400);
    sgfplib.GetMaxTemplateSize(mMaxTemplateSize);
    debugMessage("TEMPLATE_FORMAT_SG400 SIZE: " + mMaxTemplateSize[0] + "\n");
    mRegisterTemplate = new byte[mMaxTemplateSize[0]];
    mVerifyTemplate = new byte[mMaxTemplateSize[0]];
    /*   boolean smartCaptureEnabled = this.mToggleButtonSmartCapture.isChecked();
    if (smartCaptureEnabled)
        sgfplib.WriteData((byte)5, (byte)1);
    else
        sgfplib.WriteData((byte)5, (byte)0);
    if (mAutoOnEnabled){
        autoOn.start();
        //  DisableControls();
    } */
    //Thread thread = new Thread(this);
    //thread.start();
}
 catch(Exception e ){
    Toast.makeText(this, "mSize is   "+ mMaxTemplateSize[0], Toast.LENGTH_LONG).show();
    Toast.makeText(this, "Exception is  "+e.getMessage(), Toast.LENGTH_LONG).show();
}

我有异常。问题出在哪里 ?你能帮助我吗 ?

在你的 catch 中添加一个日志,如下所示:

}catch(Exception e ){
    Log.e("MyApp", "error in sgfplib", e);
    Toast.makeText(this, "mSize is   "+ mMaxTemplateSize[0], Toast.LENGTH_LONG).show();
    Toast.makeText(this, "Exception is  "+e.getMessage(), Toast.LENGTH_LONG).show();
}

和postlogcat发生错误时。