iink SDK on Device

Answered

构建自定义资源除了在线工具外另一种方法必须从Android客户端执行么?执行报错;我的参数该如何设置?

engine.createRecognitionAssetsBuilder().compile("Text", "1234567890");


java.lang.IllegalArgumentException: unsupported type of recognition asset

        at com.myscript.iink.NativeFunctions.compile(Native Method)

        at com.myscript.iink.RecognitionAssetsBuilder.compile(RecognitionAssetsBuilder.java:71)


这个错误我该如何处理?或该如何改造?


Best Answer

Hi Li,


Thank you for your update.


It is not possible to compile a Subset Knowledge resource on-device with RecognitionAssetsBuilder.

I you want to use a Subset Knowledge resource, you must compile them with the online tool via the Developer Portal :

https://developer.myscript.com/docs/interactive-ink/1.4/windows/advanced/build-custom-resources/#via-the-developer-portal


Best regards,


Gwenaëlle


Dear Li Perry,


Thank you for contacting us.


You are getting this error because "Text" is not a supported resource type.


When compiling resources on device, Interactive Ink SDK allows you to generate text lexicons and math grammars. You shall respectively choose "Text Lexicon" and "Math Grammar" as the target asset type for the Type argument of the compile method.


For further details, please refer to

https://developer.myscript.com/docs/interactive-ink/1.4/windows/advanced/build-custom-resources/#on-device


Best regards,


Gwenaëlle

那我需要支持 subset knowledge 这个类型可以么?

I need to support subset knowledge. Is that ok?





engine.createRecognitionAssetsBuilder().compile("Subset knowledge ", "1234567890");

String internalStoragePath = context.getFilesDir().getPath();

File file = new File(internalStoragePath, File.separator + "test3.res");

assetsBuilder.store(file.getPath());

我调用上面的方法生成的 subset knowledge  test3.res文件,不经过重新编译打包apk直接使用,是否可行

Can I use APK directly without recompiling and packaging


Answer

Hi Li,


Thank you for your update.


It is not possible to compile a Subset Knowledge resource on-device with RecognitionAssetsBuilder.

I you want to use a Subset Knowledge resource, you must compile them with the online tool via the Developer Portal :

https://developer.myscript.com/docs/interactive-ink/1.4/windows/advanced/build-custom-resources/#via-the-developer-portal


Best regards,


Gwenaëlle

  • Support
  • Forums
  • iink SDK on Device
  • 构建自定义资源除了在线工具外另一种方法必须从Android客户端执行么?执行报错;我的参数该如何设置?