SCiO Sensors need to be calibrated or recalibrated in order to provide accurate scans over time. Calibration is done by having the user place their SCiO Sensor in the SCiO Cover and having the SCiO “scan” the cover, which serves as a white reference. You will be notified when calibration is required.
To calibrate, put the SCiO Sensor into the SCiO cover with the optical head facing down into the cover, the app should call the calibrate method.
In addition, a SCiO scan can return onNeedCalibrate indicating that the SCiO must be calibrated in order to perform another successful scan.
The following code sample calibrates a SCiO sensor:
public void calibrateDevice(final ScioDevice device) { myScio.calibrate(new ScioDeviceCalibrateHandler() { @Override public void onSuccess() { /* In order to write to the UI, run the function on a UI thread.*/ runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(deviceContext, "Your device has been calibrated. You may now use it to scan samples.", Toast.LENGTH_SHORT).show(); } }); Log.i("DemoApp calibrate", "success"); } @Override public void onError() { runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(deviceContext, "Your device has NOT been calibrated. Try again or wait for this to be automatically reset", Toast.LENGTH_SHORT).show(); } }); Log.i("DemoApp calibrate", "error"); } @Override public void onTimeout() { runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(deviceContext, "Your device has NOT been calibrated. Try again or wait for this to be automatically reset", Toast.LENGTH_SHORT).show(); } }); Log.i("DemoApp calibrate", "timed out, try again"); } }); }