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

时间:2015-07-26 07:52:32

标签: android fingerprint

在恢复方法上,我有以下代码:

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();
}

我有例外。问题出在哪儿 ?你能帮助我吗 ?

1 个答案:

答案 0 :(得分:1)

在你捕获时添加一个日志:

}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();
}

发生错误时发布logcat。