Hello,
When you get the blockIds from iink APIs like the JIIX export or contentChanged callback, you can use "itemIdHelper.getItemsByBlockId(blockId)" to get the iink stroke ids, that you will then be able to map to your own APP stroke ids with the mapping that you should be keeping somewhere in your model.
You can see it in our sample on github: https://github.com/MyScript/interactive-ink-additional-examples-android/blob/31950c701a1787dbfe1fefb76bd81170ed59a89d/samples/offscreen-interactivity/src/main/java/com/myscript/iink/demo/inksample/ui/InkViewModel.kt#L136
Let me know if your need further guidance.
Yann
Hello,
I am not completely sure I fully understand what your struggling with, I'll try an explanation but if it's not enough, I may need to know a bit more about your integration.
- When you call "addStrokes()", you add stroke to the iink model, and in turn you receive the iink stroke ids. It is important that you keep these in a map, because that's how you'll know which ones are related to your app' strokes.
- I am not sure where you get your "blockId" from, but usually you'll get them from the contentChanged callback, or the export method. The block ids are NOT the same as stroke ids. If you want to know which iink strokes belong to a block id, that's when you call itemIdHelper.getItemsByBlockId(blockId). Then, when you have those iink stroke ids, you need to use your existing mapping to know which of your own app strokes are related to this blockid.
This mapping is not trivial but really important. You'll see a full example in our offscreen sample (https://github.com/MyScript/interactive-ink-additional-examples-android).
Finally, regarding your screenshot, on the third line when you call "getItemsByBlockId(blockId)" with blockId "raw-content/13122", I would expect to see the strokeId shown on your first line. At the moment the screenshot you sent shows only the address of the string, not the value itself.
Also, the contentChanged method will give you all the blocks that have been modified in your document, that's why you will always end up with "MainBlock". In your case, even though 2 different strings are created with different addresses (line 3 and line 5), if you print there values they should be the same.
I hope this helps,
Yann
Sid20245666
I need to get the strokes data corresponding to my APP layer through itemIdHelper?.getItemsByBlockId(blockId). Where does the blockId here come from? Is it raw-content/11?