Text

SCW Delay Android

Hi Everyone:

I've been testing the SCW and it works really well. The only problem that I have is that because I just want to receive a single character at a time I reset the value in the TextField. But now the characters that require multiple strokes like A or X wont work properly.

I believe the solution is to increase the delay before the character starts to be recognized maybe using setAutoCommitDelay, but I don't know exactly how to do that.

I would appreciate your help!


Dear Imalo,

thank you for contacting us.

You could proceed as in the following post: http://developer-support.myscript.com/support/discussions/topics/16000007714

In the OnRecogntionEnd function, you can retrieve each character, proceeding as follows:


if (mActiveField != null) {

 String characteresult=null;
 String result = mWidget.getText();
 int nbCandidatesText = result.length();
 
 CandidateInfo candidate = mWidget.getCharacterCandidates(nbCandidatesText-1);
 characteresult = candidate.getSelectedLabel();

 mActiveField.setOnSelectionChangedListener(null);
 mActiveField.setText(characteresult);
 mActiveField.setOnSelectionChangedListener(this);
 mActiveField.setSelection(0);
}


This way, you do not have to change the delay with the setAutoCommitDelay.

Let us know id this helps.

Best regards,

Olivier

Thanks Olivier and sorry for the delayed answer.

This worked partially, I had to use:

mWidget.clear()

to clear the result after each character.

Thanks again.

Login or Signup to post a comment