Here we are, now this last part is for the demonstration.

First I have created a small & quick backend using spring boot, I am not going to demonstrate the whole process, but some key points are required to use Google’s API and Azure FormRecognition

I am currently using Eclipse editor for this.

We need to include some necessary groups and artefacts in Maven to get the Java packages, as shown below.

To have permission to Google Firebase, some additional resources need also to be included, especially the ServiceAccountKey which can be retrieved from the project setting you defined earlier in Firebase SDK setup and configuration.

So first you will need to initialize the service, this can be done via the @Service annotation since we keep the firebase service “online”, we are also going to use the @PostConstruct annotation as shown below.

Then a controller will allow the mobile App in Flutter to trigger the OCR process, via a GET, however, POST could be more appropriate if you wish to store resources in a back-end system.

Note this is to simplify the process, actually, it could also be a WEB application through a workflow. I will explain later how it works.

In my POC below, the OCR will be launched via the end-point /OcrDoc.

As you discover, this is going to trigger the service firebaseService.ProcessPDFOCR().

The method will go through the list of documents in Firebase having the status “Pending” (see Part II for details about what happens when you take a photo of your receipts.) and process them via RecognizerReceipts.

Cloud Firestore showing “pending” document.

See code below for some insight

The OCR processor, simple static method to do the job!

So, the line below set the modelID we have created in the previous part of this post.
String modelId = “25ccc295-cea6–451e-8598-b77e6056ae00”
The client returned will therefore analyse the form from my firebase storage URL

SyncPoller<FormRecognizerOperationResult, List<RecognizedForm>> recognizeFormPoller = client.beginRecognizeCustomFormsFromUrl(modelId, formUrl)

So let’s try it :-)

The last entry shows a receipt that I have uploaded via the mobile app in Flutter, discussed in previous posts on this long subject. The status is currently “pending”

Start from Eclipse the spring boot server

Get the OcrDoc end-point


Then we can actually store properly details of the ticket from a simple picture via your smartphone.

I hope this article will maybe help you to investigate these new tools, but anyway, for me, it was fun, and I am happy to share.




Ramblings of an agile enthusiast

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Layoutit Grid v2

Too many Dashboards?

Writing an Agile Playbook for a Federal Agency? — Shipley to the Rescue!

Evolution of Windows OS

Linux for beginner professional

Working with Java Variables

Title image

Four different ways to summarize your text using Python

⌨️How I coded a website in 48h with zero coding experience.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alexandre Claus

Alexandre Claus

Ramblings of an agile enthusiast

More from Medium

Today’s discovery: Using mockito with flutter.

Flutter101: [part-2] impatient guide Riverpod providers when to use what?

Flutter: Easily add CI testing with GitHub Actions

Save data to “Shared Preferences” with Singleton pattern