B4A Library Digital Ink Recognition based on ML Kit

1737285044676.png
1737285295799.png


This is a B4A class that wraps ML Kit digital ink recognition. More information here: https://developers.google.com/ml-kit/vision/digital-ink-recognition

Open B4A Sdk Manager and install the following resources:
B4X:
androidx.room:room-common-jvm

Usage is quite simple and demonstrated in the attached example.
The app collects a list of strokes which are then processed with a call to recognizer.Recognize. The top 10 candidates are returned.

It supports many languages: https://developers.google.com/ml-kit/vision/digital-ink-recognition/base-models#text
The language model is downloaded if needed.
Don't miss the manifest editor snippet.
 

Attachments

  • DigitalInk.zip
    183.1 KB · Views: 69
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
In the future they will be included in the SDK package.

For now you will need to download them, however don't search one by one. Search for androidx.room, androidx.work, androidx.paging and androidx.compose, and install everything. It will not take you more than 7 minutes.
 

Mehrzad238

Active Member
androidx.room
Hello, I am getting an error while trying to install resources.

HTML:
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/logos/errorpage/error_logo-150x54.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/logos/errorpage/error_logo-150x54-2x.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/logos/errorpage/error_logo-150x54-2x.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/logos/errorpage/error_logo-150x54-2x.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>  <ins>That’s all we know.</ins>

This error comes from at least 10 of them or more
In the end, I got stuck at👇👇

B4X:
Maven artifact not found: androidx.sqlite/sqlite
Source: androidx.room:room-runtime
 

Attachments

  • Screenshot 2025-01-20 001244.png
    Screenshot 2025-01-20 001244.png
    179.4 KB · Views: 142
  • fullerror.txt
    12.2 KB · Views: 132

Mehrzad238

Active Member
Tools - B4A Sdk Manager - install the missing artifact. There are many resources that you will need to install.
I know what must be done the problem is it does not download the resources( only 7 of them remains, i installed the rest of them ),I attached the screenshot on post #5
 

Mehrzad238

Active Member
It fails to download "test-services". You don't need it. You also don't need the ios*, mac* or linux* resources.
If it doesn't work for you then wait for the updated package.
Ok, I got it.
I just got excited i want to test myself
 

labsklinik

New Member
hello all, got error:


B4A Version: 13.30
Parsing code. (0.20s)
Java Version: 19
Building folders structure. (0.04s)
Running custom action. (0.05s)
Compiling code. (0.19s)
Compiling layouts code. (0.01s)
Organizing libraries. Error
Maven artifact not found: androidx.compose.animation/animation-lint
Source: androidx.room:room-runtime



I used :
androidx.room\:room-runtime=2.2.6,
still error.

what version should I use?

tx all
 
View attachment 160942 View attachment 160944

This is a B4A class that wraps ML Kit digital ink recognition. More information here: https://developers.google.com/ml-kit/vision/digital-ink-recognition

This feature has a large set of dependencies. I recommend starting with a simpler feature such as this one: https://www.b4x.com/android/forum/threads/b4x-textrecognition-based-on-mlkit.161210/#content
Once you get it working you can continue with the digital ink feature.

Open B4A Sdk Manager and install the following resources (you might need to install a few more resources. If you get a "missing module" during compilation then install it):
B4X:
androidx.work:work-gcm
androidx.work:work-multiprocess
androidx.room:room-runtime
androidx.room:room-common
androidx.room:room-compiler
androidx.room:room-compiler-processing
androidx.room:room-compiler-processing-testing
androidx.room:room-guava
androidx.room:room-gradle-plugin
androidx.room:room-migration
androidx.room:room-paging
androidx.room:room-paging-android
androidx.room:room-ktx
androidx.room:room-paging-guava
androidx.room:room-paging-rxjava2
androidx.room:room-runtime-android
androidx.room:room-paging-rxjava3
androidx.room:room-rxjava2
androidx.room:room-rxjava3
androidx.room:room-testing
androidx.room:room-testing-android
androidx.sqlite:sqlite
androidx.sqlite:sqlite-android
androidx.sqlite:sqlite-framework
androidx.sqlite:sqlite-framework-android
androidx.sqlite:sqlite-ktx
androidx.paging:paging-common
androidx.paging:paging-common-android
androidx.paging:paging-common-ktx
androidx.paging:paging-compose
androidx.paging:paging-compose-android
androidx.paging:paging-guava
androidx.paging:paging-runtime
androidx.paging:paging-runtime-ktx
androidx.paging:paging-rxjava2
androidx.paging:paging-rxjava2-ktx
androidx.paging:paging-rxjava3
androidx.paging:paging-testing
androidx.paging:paging-testing-android
androidx.compose.animation:animation
androidx.compose.animation:animation-android
androidx.compose.animation:animation-core
androidx.compose.animation:animation-core-android
androidx.compose.animation:animation-graphics
androidx.compose.animation:animation-graphics-android
androidx.compose.animation:animation-tooling-internal
androidx.paging:paging-common-jvm
androidx.paging:paging-testing-jvm
androidx.work:work-runtime
androidx.work:work-runtime-ktx
androidx.work:work-rxjava2
androidx.work:work-rxjava3
androidx.work:work-testing

Usage is quite simple and demonstrated in the attached example.
The app collects a list of strokes which are then processed with a call to recognizer.Recognize. The top 10 candidates are returned.

It supports many languages: https://developers.google.com/ml-kit/vision/digital-ink-recognition/base-models#text
The language model is downloaded if needed.
Don't miss the manifest editor snippet.
I get following error while compiling:
B4A Version: 13.40
Parsing code. (0.25s)
Java Version: 19
Building folders structure. (0.14s)
Running custom action. (0.11s)
Compiling code. (0.40s)
Compiling layouts code. (0.00s)
Organizing libraries. Error
Maven artifact not found: androidx.room/room-common-jvm
Source: androidx.room:room-runtime
 
Installed still getting

B4A Version: 13.40
Parsing code. (0.21s)
Java Version: 19
Building folders structure. (0.13s)
Running custom action. (0.07s)
Compiling code. (0.42s)
Compiling layouts code. (0.00s)
Organizing libraries. Error
Maven artifact not found: androidx.room/room-common-jvm
Source: androidx.room:room-runtime
1752831113434.png
 
Top