Save every single greek character into a csv file -ATK Scw Sample(Android)

I am using scw sample from ATK (android version/greek) and I would like to ask you how can I save every single recognized character of scw atk sample into a csv file. I have created a method that saves the text in a csv file but I am confused about where I should call it. For the time being, I am calling it from the method onTextChanged but only the last modified text is saved in the file and not as single character as I want but as plain text. Moreover I would like to ask you which parameters should I use to recognize the greek letters into the csv file?
Thank you!!

Dear Gkal,

thank you for contacting us.

First, regarding using the onTextChanged function to get your result, this is not likely to be the best choice, as it may return with an intermediate result, which may change in the near future, as explained into the API documentation. Instead, I would rather recommend you get the result in the onRecognitionEnd function.

Now, to get characters, you can use the getCharacterCandidates function, which given an index, will return with the potential character candidates. For example, to get the selected character of character 0, you can proceed as follows:

CandidateInfo candidate = mWidget.getCharacterCandidates(0);
String characteresult = candidate.getSelectedLabel();

Moreover I would like to ask you which parameters should I use to recognize the greek letters into the csv file
>>I am not sure to properly understand. Indeed, if you set the greek language, you will be returned with greek characters. These are normally return in UTF-8, which you can then save in a file with the encoding?

Best regards,


Hello Olivier,

Thank you very much for your response. Your informations are very usefull but I have 2 issues.

The first one is that the “getCharacterCandidates” function is right only if I select the character 0, otherwise it gives me an error. I want to save every single drawn character into a file and not only the first one.
The second problem is that I want to compare every single character with a letter or a number to find out if it is the specific character. For example, I want to recognize if the letter Γ is located before of tha letter Κ in the file where I saved all the drawn characters. Is that possible with any kind of enconding? I try to compare it as a string (K==characteresult) but it is not possible.

Dear Gkal,

In order to get the latest character candidate, you could proceed as follows:

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

I just tested it on my side, and it worked perfectly.

I want to recognize if the letter “Γ” is located before of tha letter “Κ”
>>As long as you are using the utf-8 encoding, it should work properly.

Let us know if this helps.

Best regards,


Thank you very much for your response, it is very helpful!!
The last thing I want to ask is if there is a way to change the appearance of the activity_main.xml (for example by adding a textview or changing colors). I tried to add things to every type of activity_main.xml file and to the MainActivity class but nothing changes.

Dear Gkal,

you can change things like colors in the MainActivity.java file, for example in the onCreate function:
Here is an example:

  protected void onCreate(Bundle savedInstanceState) {


mHandler = new Handler();
mResourceHelper = new SimpleResourceHelper(this);
mLanguageManager = new LanguageManager(this);

mLangButton = (Button) findViewById(R.id.btn_lang);
mDeleteButton = (Button) findViewById(R.id.btn_delete);
mSpaceButton = (Button) findViewById(R.id.btn_space);
mReturnButton = (Button) findViewById(R.id.btn_return);
mCandidateLayout = (LinearLayout) findViewById(R.id.candidate_layout);


mWidget = (SingleCharWidget) findViewById(R.id.widget);


Other colors can be changed the same way.

Regarding adding new textviews, in your code, you can indeed create as many textViews as you want (or as your device allows), and create a new instance of the SingleChar Widget in this TextView.

Let us know if you need further explanations.

Best regards,


Login or Signup to post a comment
  • Support
  • Forums
  • Text
  • Save every single greek character into a csv file -ATK Scw Sample(Android)