I want to stop wasting time creating invoices — part 2

Pancho AM
4 min readMar 17, 2024

--

Considering the statement step by step and considering which coding language and platform would fit the purpose best.

Maybe coding an APK?

Code android to retrieve the picture and use Document AI SDK?

Free sounds more convincing, free options?

https://news.ycombinator.com/item?id=26683637

Seems tesseract looks good for someone.

It’s an API to process the images, I don’t feel comfortable sharing my receipts and leaving them out there online.

Not that many options that look interesting to me:

Google search 1

Google search 2

Google search 3

They’re all APIs.

If I’ll be using an API anyway, I think it’d be best to use Google’s Document AI

And the prices are not that expensive considering the low usage we’ll give to it.

I must confess that whatever OCR processor I pick the use of Cloud Functions does sound appealing.

  1. Take a picture.

2. With an out of the box app that just takes pictures and uploads them into a GCS bucket

I think I can use this:

https://github.com/googleapis/java-storage

3. Process OCR

4. After uploading the picture to GCS, a Cloud Function can be triggered to get the text, this cloud function can have the code to get it done, I think I could get that done after going through the lab below:

https://codelabs.developers.google.com/codelabs/docai-ocr-python#0

  1. Display a clock or whatever to let the user know OCR’s in progress.
  2. Ask user to validate data with a simple ok or edit.
  3. Fill out consignment paper for insurance company
  4. Ask user to validate the issuer’s website and/or specific invoice part of their website
  5. Send the data to the website
  6. Display a clock or whatever to let the user know the invoice is in process
  7. Success/fail

I’ll focus on steps 1 and 2 for starters.

So I’ll begin with https://github.com/googleapis/java-storage

What java to use when coding an android app (APK), maven or gradle?

What’s the difference between maven and gradle?

Oh, they’re called, development tools, I thought they were some sort of frameworks to code in java with, checking this article out:

Which Java Development Tool — Maven or Gradle — Is Best For You?

I’m a lazy ass, so my taste is biased with what’d be the easiest to use XD

So far Gradle looks like that choice.

As per compatibility, the quickstarts and the SDKs are compatible with both.

What’s more comfortable to code with maven or gradle?

Maven’s easier than Gradle it seems, since Gradle is the option for big projects.

  1. https://www.quora.com/How-would-you-choose-between-Maven-and-Gradle
  2. https://www.reddit.com/r/javahelp/comments/lpnpi2/maven_vs_gradle/
  3. https://www.softwareyoga.com/10-reasons-why-we-chose-maven-over-gradle/

I’ll go by this explanation in point 2:

Gradle is a scripting language.

Maven is a configuration description.

I’m going with Maven, and I already have it installed.

Got myself a full sample 😀

https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/UploadObject.java

I’ll start with the setup:

1.

2.

But I want to change the theme.

You have to close and open up NetBeans by the way.

Much better.

Following the getting started:

gcloud auth login and gcloud config set project [YOUR PROJECT ID].

How am I going to turn this into an APK, I think I should’ve done Android Studio instead.

Thought I had it installed, installing it.

https://developer.android.com/studio/install#linux

Downloading

https://developer.android.com/studio

Done, now importing the one I had in NetBeans

Part 3

--

--

Pancho AM

Truth is a journey, not a destination. Love it, pursue it, and never give up on it.