I used the information from lamw_create_new_datalogic_component and the other information to get the API from datalogic working.
The samplecode from lamw_create_new_datalogic_component is working, but is only the first step. if you want wo work with the barcodescanner you have to use in java the "BarcodeManager" from the API. This the major part. Initializing is not the problem, but the API is based on get the information only with callbacks
If you look inside the samples of the API (DecodeSampleAPI) you see the declaration
public class MainScanActivity extends Activity implements ReadListener,
StartListener, TimeoutListener, StopListener {
The four callback (Activity in Java) implents the working part and the four callbacks are bound or unbound to the Barcodemanager
// Register this activity as a listener for several scanner events
private void registerListeners() {
try {
mBarcodeManager.addReadListener(this);
mBarcodeManager.addStartListener(this);
mBarcodeManager.addStopListener(this);
mBarcodeManager.addTimeoutListener(this);
Log.e(TAG, "Cannot add listener, the app won't work");
showMessage("ERROR! Check logcat");
finish();
}
}
// Unregister this activity as a listener
private void releaseListeners() {
try {
mBarcodeManager.removeReadListener(this);
mBarcodeManager.removeStartListener(this);
mBarcodeManager.removeStopListener(this);
mBarcodeManager.removeTimeoutListener(this);
} catch (DecodeException e) {
Log.e(TAG, "Cannot remove listeners, the app won't work", e);
showMessage("ERROR! Check logcat");
finish();
}
}
and on of the listener itselft
@Override
public void onRead(DecodeResult result) {
String string
= result.
getText(); if( string!= null) {
showScanResult.append("Result: " + string);
}
}
and this onRead and the other Activities are my problem.
I have tried to write a java programm to work with the BarcodeManager, but i have the same problem - how can i send the data back to my pascal in a OnData call. ?!