Interactive Ink

how to get realtime response when each time pen up?

public void convert() {
       
editor.waitForIdle();
       
try {
           
String s = editor.export_(editor.getRootBlock(), MimeType.JIIX);
           
JSONObject jiix = new JSONObject(s);
           
String label = jiix.getString("label");
           
Log.e(TAG,label);
           
if (mListener != null) {
               
mListener.onReconResultGet(label);
            }
        }
catch (Exception e) {
           
e.printStackTrace();
        }
    }



I use android iink 。when I write”好好学习 天天向上”,and call convert() at each time of pen up。

But Now I get the first  response when I finish writing all the wordssuch as

Response1:好好学习 天天向上

Response2:好好学习 天天向上

Response3:好好学习 天天向上

Response4:好好学习 天天向上

Response5:好好学习 天天向上

Response6:好好学习 天天向上

Response7:好好学习 天天向上

Response8:好好学习 天天向上


I need to get response several times, when I finish writing one wordI want to get the real time responsesuch as

Response1:好

Response2:好好

Response3:好好学

Response4:好好学习

Response5:好好学习 

Response6:好好学习 天天

Response7:好好学习 天天向

Response8:好好学习 天天向上

so how can I get the response like  this?


Dear Tolu,


thank you for your question.


Currently, the reason you are getting these responses is that strokes are added continously. This way, you are never in "idle" state. Removing the "editor.waitForIdle()", you will be notified with each update of the result. The drawback is that result will be updated for each new stroke added.


Best regards,


Olivier

when I remove the "editor.waitForIdle(),the reponse is not  completely。the result is like "好好学习 天天",rather than "好好学习 天天向上".

some words will not return.

Dear Tolu,


this is indeed surprising. Are you waiting "long time" enough to get the full result?


Best regards,


Olivier

Login or Signup to post a comment