I am using mantra fingerprint scanner to get finger print data, I want to store the fingerprint data in mysql.Later i want to compare with other. I am facing issue in Storing the data in mysql.
here is the code where after scanner gives the fingerprint data.
private void StartSyncCapture() {
runOnUiThread(new Thread(new Runnable() {
@Override
public void run() {
try {
FingerData fingerData = new FingerData();
int ret = mfs100.AutoCapture(fingerData, timeout, false,
true);
if (ret != 0) {
Toast.makeText(getApplicationContext(), "StartSyncCapture " + mfs100.GetErrorMsg(ret), Toast.LENGTH_SHORT).show();
} else {
if (fingerData.Quality() >= minQuality) {
final Bitmap bitmap = BitmapFactory.decodeByteArray(
fingerData.FingerImage(), 0,
fingerData.FingerImage().length);
imgFinger.post(new Runnable() {
@Override
public void run() {
imgFinger.setImageBitmap(bitmap);
imgFinger.refreshDrawableState();
}
});
Toast.makeText(getApplicationContext(), "Capture Success", Toast.LENGTH_SHORT).show();
String log = "\nQuality: " + fingerData.Quality()
+ "\nNFIQ: " + fingerData.Nfiq()
+ "\nWSQ Compress Ratio: "
+ fingerData.WSQCompressRatio()
+ "\nImage Dimensions (inch): "
+ fingerData.InWidth() + "\" X "
+ fingerData.InHeight() + "\""
+ "\nImage Area (inch): " + fingerData.InArea()
+ "\"" + "\nResolution (dpi/ppi): "
+ fingerData.Resolution() + "\nGray Scale: "
+ fingerData.GrayScale() + "\nBits Per Pixal: "
+ fingerData.Bpp() + "\nWSQ Info: "
+ fingerData.WSQInfo();
Toast.makeText(getApplicationContext(), "fingerData.Quality()" + fingerData.Quality() + "StartSyncCapture is " + fingerData.ISOTemplate().length, Toast.LENGTH_SHORT).show();
mFingerData = fingerData;
//////////////////// Extract ISO Image
int dataLen = 0;
byte[] tempData = new byte[(mfs100.GetDeviceInfo().Width() * mfs100.GetDeviceInfo().Height()) + 1078];
byte[] isoImage = null;
dataLen = mfs100.ExtractISOImage(fingerData.RawData(), tempData);
if (dataLen <= 0) {
if (dataLen == 0) {
Toast.makeText(getApplicationContext(), "Failed to extract ISO Image", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(), mfs100.GetErrorMsg(dataLen), Toast.LENGTH_SHORT).show();
}
return;
} else {
isoImage = new byte[dataLen];
System.arraycopy(tempData, 0, isoImage, 0, dataLen);
mISOImage = new byte[dataLen];
System.arraycopy(tempData, 0, mISOImage, 0, dataLen);
}
} else {
Toast.makeText(getApplicationContext(), "Please try again", Toast.LENGTH_SHORT).show();
}
}
} catch (Exception ex) {
Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_SHORT).show();
}
}
}));
}