iink SDK Web

Answered

About Android environment integration cloud recognition.

发送   newContentPackager

返回类型确认 

发送   {

 “ type” “ newContentPart” 
 “ contentType” “ MATH” “ mimeTypes” :[ “ application / x-latex” “ application / mathml + xml” }  
发送配置 
发送 {

 类型“ addStrokes”  

 笔画“ id” 'pending-1' “ pointerType     
“  
 'PEN' “×” 273 278 281 ],“Y” 121 128       
133 ],“ t”    
3185.7900000000004 3 
213.8150000000005 3222.5350000000003 ],“P” 1.3 1.3 1.3 }        
系统返回给我“ 键入错误消息,当前内容无内容   

我想知道Android是否不能使用WebSockets或为什么 



Best Answer

Dear 新 雷,


Thank you for your update.


In the configuration of your code sample, you should make following changes:


  1. The configuration message must be sent before creating the part, else the configuration is not applied to the new part. So you must move your configuration block code before your contentpart block code.
  2. In your configuration json there is a small mistake on the language key name: it must be "lang" (not "language"). So in your code the line "\"language\":\"zh_CN\",\n"+must be replaced by "\"lang\":\"zh_CN\",\n" +



With those updates, the strokes are recognized as 干as you expect.


Regards,

 

Gwenaëlle


send   newContentPackager

return "type ack"

send{

“ type” “ newContentPart”

“ contentType” “ MATH” “ mimeTypes” :[ “ application / x-latex” “ application / mathml + xml” ] }

send configuration

send {

 {

type: "addStrokes",

strokes: [

{ "id": 'pending-1', "pointerType" : 'PEN', "x": [273, 278, 281], "y": [121, 128, 133], "t": [3185.7900000000004, 3213.8150000000005, 3222.5350000000003], "p": [1.3, 1.3, 1.3] } ] }

The system returned to me "type error message, no content part curent found

I wonder if Android can't use WebSockets or why

Dear Sir,


thank you for contacting us.


First, there is no reason webSocket cannot be done on Android.


On your side, can you confirm you get the "partChanged" event before sending the configuration and strokes?


Best regards,


Olivier