Android Question Digital Ink Recognition not Working in Activity based due to Initialization Error

omo

Active Member
Licensed User
Longtime User
Referring to Erel example of digital Ink recognition here @ https://www.b4x.com/android/forum/threads/digital-ink-recognition-based-on-ml-kit.165168/

Has anybody observed why it is not working with Activity based project? It is working well for me with b4xpages, but unlike other mlkit recognitions from Erel that are easily adapted to activity based on choice and purpose, only digital ink recognition always fail at initialization stage. AI couldn't solve it either, they only help wasting time speaking nice nice structured grammar that will end up not working.

I first converted it without AI, but always failed at initialization stage. Other mlkit recognitions didn't give me much headache to adapt to activity based unlike digital ink. I later used different AI like grok, Gemini etc , but still failed at the initialization stage. I used "en" and even "latin", but still the same error

Please, if anybody has succeeded adapting it to activity based; please kindly help adapting Erel example or your modified activity based example.
 

omo

Active Member
Licensed User
Longtime User
Please post the full error message from the logs.
Thank you Erel for your response. I was absent throughout yesterday in the forum except 2 minutes when l clicked on my email alert to enter forum to read your response.

I couldn't get any log, I ran it on phone and couldn't program get crash through email logcat. I quickly put one activity based together in the attached below to look into and run or just help us with activity based of your example in your afore mentioned link.
 

Attachments

  • handwritingtest.zip
    11.4 KB · Views: 1
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
1775738875848.png


I was able to get it working after updating the manifest editor based on the updated example: https://www.b4x.com/android/forum/threads/digital-ink-recognition-based-on-ml-kit.165168/#content

And add to Main:
B4X:
#AdditionalJar: androidx.tracing:tracing
(I will update the tutorial with this)

Other issues:
Label1 wasn't added to the layout.
The scrolling label should be assigned a TextEngine: https://www.b4x.com/android/forum/t...bel-rich-text-scrolling-label.114310/#content

I recommend removing all the Try / Catch blocks. They only make things more complicated to debug.
And the timers should also be removed.

And it will be much simpler to implement it with B4XPages.
 
Upvote 0

omo

Active Member
Licensed User
Longtime User
Note that the missing dependency was already included in the example project.
Whaoo, thank you so much Erel! I am so grateful. Yes, as I said earlier in my question; b4xpages version I adapted from your example is working well for me, but for some reason; I just need to ensure both b4xpages and activity are always on standby. Your instructions noted.
 
Upvote 0
Top