Recent

Author Topic: [Solved]How to make an android app to scan datamatrix barcode?  (Read 2717 times)

Jonvy

  • Jr. Member
  • **
  • Posts: 90
Hello all,

I'm new for LMAW, now I want to wirte an app to scan barcode, I runned the demo AppZBarcodeScannerViewDemo1, and find it only can
scan 1D barcode and QR 2D barcode.
But for my work, I should mostly scan datamatrix barcode.
 
Is there any way to scan datamatrix barcode with lazarus?

I can not find resource for it, can anyone help me?

Thanks!

Jonvy
« Last Edit: March 23, 2023, 02:34:24 pm by Jonvy »

loaded

  • Hero Member
  • *****
  • Posts: 825
Re: How to make an android app to scan datamatrix barcode?
« Reply #1 on: March 10, 2023, 06:12:48 am »
Hi ,
You can use the "AppIntentDemoZXing1" demo for this.
The "Barcode Scanner By ZXing Team" application must be installed on the device beforehand. You can install it from Play Store.
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

Jonvy

  • Jr. Member
  • **
  • Posts: 90
Re: How to make an android app to scan datamatrix barcode?
« Reply #2 on: March 11, 2023, 03:52:46 am »
Hello loaded,
I tried to run this demo, but I get following error(See attachment).

How can I do, where is the compileDebugRenderscript?

Also I can not find gradle.properties file in my directory.

Jonvy

loaded

  • Hero Member
  • *****
  • Posts: 825
Re: How to make an android app to scan datamatrix barcode?
« Reply #3 on: March 11, 2023, 08:43:34 am »
Yes you are right, it throws error in gradle. I don't know why, it seems like research is needed to solve the problem.
To get rid of such errors I also use ant for faster compilation.
It's working fine for me too.
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

Jonvy

  • Jr. Member
  • **
  • Posts: 90
Re: How to make an android app to scan datamatrix barcode?
« Reply #4 on: March 11, 2023, 01:10:29 pm »
Hi ,
You can use the "AppIntentDemoZXing1" demo for this.
The "Barcode Scanner By ZXing Team" application must be installed on the device beforehand. You can install it from Play Store.
I made some change to the gradle file to make the app work.
Because I'm in China, I can not use Play store, so  Barcode Scanner zxing app is not possible installed.
However, I can find the zxing core from following address,
https://repo1.maven.org/maven2/com/google/zxing/core/3.3.0/

But how can I compile the zxing package into this demo app, so I can use it without zxing Scanner app?

Jonvy

loaded

  • Hero Member
  • *****
  • Posts: 825
Re: How to make an android app to scan datamatrix barcode?
« Reply #5 on: March 11, 2023, 02:08:53 pm »
I think jar files can be added to LAMW but I don't know how. If someone who knows the subject better than me can help, we will learn together.
If you can't use the play store. You can also download it from another apk download site.
Another option is if the device you are using has a built-in browser, you can do some research and try to access and run it using intent.
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: How to make an android app to scan datamatrix barcode?
« Reply #6 on: March 12, 2023, 06:52:34 pm »
Quote
I think jar files can be added to LAMW......

Yes! "jBarcodeGen"  use "zxing-3.4.0.jar"....  the demo is here:   "AppBarcodeGenDemo1"


Edited: I'm building a new component "jcZXingBarcodeScan" based on  "ZXing Android Embedded" library.... wait until I finish some tests...
« Last Edit: March 13, 2023, 07:42:03 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

loaded

  • Hero Member
  • *****
  • Posts: 825
Re: How to make an android app to scan datamatrix barcode?
« Reply #7 on: March 13, 2023, 02:18:48 pm »
I'm building a new component "jcZXingBarcodeScan" based on  "ZXing Android Embedded" library.... wait until I finish some tests...

Master jmpessoa;
Don't give us fish, teach us how to fish.  ;D
In fact, it will be much more appreciated if you record and publish this process as a video.
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

loaded

  • Hero Member
  • *****
  • Posts: 825
Re: How to make an android app to scan datamatrix barcode?
« Reply #9 on: March 14, 2023, 06:02:04 am »
First of all, thank you very much for all your efforts, Master jmpessoa. Thanks to you, we will now be able to catch bigger fish.

I want to express an opinion that comes to my mind about a situation that I think is related to the subject, it is not a request or a request;
I am currently interested in SAF (Open files using storage access framework) to be used in a project.
https://developer.android.com/guide/topics/providers/document-provider
It would seem like it would be better to replace this with the File Open dialog (jopendialog) component in LAMW.

SAF also supports file saving. This can also be used as a File Save Dialog (jSavedialog).
I think jSavedialog is a missing issue in LAMW! And this lack It can be fixed by the above method.
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: How to make an android app to scan datamatrix barcode?
« Reply #10 on: March 15, 2023, 06:56:21 pm »

Done!

New "ZXingBarcodeScan" component ! [Android Bridges jCenter tab]


reference:  https://github.com/journeyapps/zxing-android-embedded

warning: need "gradle"  and Min device API >= 24

LAMW demo:  "AppJCenterZXingBarcodeScanDemo1"


Thanks to All!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Jonvy

  • Jr. Member
  • **
  • Posts: 90
Re: How to make an android app to scan datamatrix barcode?
« Reply #11 on: March 18, 2023, 12:48:58 pm »
Thanks jmpessoa,

Your demo and component work well, I'll  study it and try to use it in my app.

By the way, I see here, google has its own ml-kit for barcode scanning also. I don't know how to use it. Is it possible to add it to LMAW also?

https://developers.google.com/ml-kit/vision/barcode-scanning/android

 

TinyPortal © 2005-2018