iink SDK on Device

Unable to add image in editor


I send file path (image).But unable to retrieve id. I am getting internal error exception (Runtime exception)

 

filepath: /storage/emulated/0/Download/IMG_20210206_231441.jpg.

 

 

String id = NativeFunctions.addImage(this.nativeRef, x, y, inputFile.getAbsolutePath(), mimeType.ordinal());

this.contentTree.setRoot(NativeFunctions.createContentNodes(this.nativeRef, this.contentTree));

ContentNode node = this.contentTree.getNodeById(id);

return node == null ? null : new ContentBlock(this.part, node);


Dear Rathish,


thank you for contacting us.


Currently, I am trying to guess what you are trying to do but there are points that are not clear:

-First, can you confirm you are doing the "addImage" in a "Text Document" part? Indeed, any other way to proceed will fail: https://developer.myscript.com/docs/interactive-ink/1.4/android/fundamentals/editing/#block-addition

-Second, why don't you use the JAVA API: https://developer.myscript.com/refguides/interactive-ink/android/1.4/com/myscript/iink/Editor.html#addImage-float-float-java.io.File-com.myscript.iink.MimeType- ; The latter would then return with an exception, that may help understand?

-Last, what's behind the call to "NativeFunction" ? This is indeed not clear to me.


Best regards,


Olivier

Hi Olivier,

I am trying to add a image in editor,  I am opening a gallery and adding that image. I am using Text document as part. I used  addImage method and pass the file as per the docs. File path and mimetype is retrieved.  After that it is going inside native function and showing internal exception. 


Regards,

Rathish.

Dear Rathish,


without a logcat or project, it is difficult to investigate further.


Please provide with these if you need more help from us.


Best regards,


Olivier

Login or Signup to post a comment