This app bundles OCR functionality and can be called from other apps via Intents. Depending on the product flavor, it either uses Mlkit or Tesseract.
It listens for Intents with action "org.totschnig.ocr.action.RECOGNIZE" and expects an Uri pointing to a JPEG file as data. The orientation of the image can be passed in with an Integer extra "orientation". Value must be either 0, 90, 180 or 270.
The recognized text is passed back in the extra "result" as an object of class Text, that must be copied into the client app:
See MyExpenses for an example: