B4A Library ZXingLib(integration version)by icefairy333

icefairy333

Active Member
Licensed User
Longtime User

but the code there is not error:sign0013: I will upload the code,you can see it yourself
 

bluedude

Well-Known Member
Licensed User
Longtime User
Sorry, library development is not my thing. So I conclude you don't have the same problem on your phone. I see some other people having the same problem.

Anyway, thanks for the response! Would love to use it but in my case it won't solve my problem.

Cheers,
 

joneden

Active Member
Licensed User
Longtime User
Hi All,

I've just tested on a Galaxy S2 running CM 10 - Android 4.1.2 and that is fine - I reworked so that a button press triggered the scan and then did a toastmessage to show the barcode.

I also tested on an Acer Liquid Glow - android 4.0.4 and again that worked fine.

Finally I did it on a Nexus and just got the blank screen even with the suggested manifest changes.

My list of improvements if ever possible would be as follows:
Portrait scanning (my app is portrait not landscape)
Embedding of the scan window in a panel (would a question to the developer of the Camera lib help - seeing as it's been done in that?)
Ability to get the bitmap that was seen at the time of the scan.

I'm going to see if I can help you add to the java....

Cheers,

J
 

Ohanian

Active Member
Licensed User
Longtime User
Hi,
i've tried the sample on Asus TF101, but got nothing, when i run the sample i only got a blinking red line, but the camera is not activated.
Any help?
 

javiers

Active Member
Licensed User
Longtime User
The camera can be displayed on a panel...

Hello,
The camera can be displayed on a panel, all in the same layout and activity?

thanks
 

susu

Well-Known Member
Licensed User
Longtime User
Hi Erel,

Could you please upgrade this wrapper library? I need turn flash on and capture scanned barcode option but this wrapper didn't support. I tried to use your CameraClass to turn on flash but the camera will be occupied so it can not scan barcode.

Thank you so much.
 

icefairy333

Active Member
Licensed User
Longtime User
I see.But in my demo I run it without scan twice(device:moto me860 with miui ics).and I have a application using this,I put it in a custom sub,it running well.
to #29 Will do it!
The second scan happens because zx.BeginScan is called from Activity_Create. The activity is recreated when you change the orientation during the scanning.

The solution is simple. Move this call to a different sub (Button_Click for example).
 

icefairy333

Active Member
Licensed User
Longtime User
:signOopsidn't say to me,I looked it and found that I can't using flash light well,so let the other friends to do it.:sign0013:
 

JTmartins

Active Member
Licensed User
Longtime User
Front camera.

Hi,

I've tried the sample, and the app does not run in the tablet. It compiles and as soon as the app goes to the tablet it immediately says " we are sorry B4A Example has been interrupted. "

However if I remove the Manifest lines, I don't get the error, but I get a black screen, and nothing else happens.


Help !!

Tablet OS ICS 4.03
B4A 2.50
 
Last edited:

icefairy333

Active Member
Licensed User
Longtime User
I don't know what's wrong with you.:sign0013:
 

JTmartins

Active Member
Licensed User
Longtime User


Well there is nothing wrong with me personally...

If I use the provided sample "as is"...It throws the mentioned error.

So I was trying to understand why the error was appearing, as it's the first time I compile an app, send it to the device, and get an immediate error before anything else happens. (same on emulator)

As in B4A 2.5 some of the manifest stuff has moved to the code modules, screen orientation, full screen, etc...I tried to take those away from the Manifest editor, and set them in the proper region in Activity.

The error disappeared, but I just get a black screen.

And I really would like to test this to see if it fits my purposes...(currently using ABZxing, works ok, but depends on an external app...I would prefer not to depend on external apps.

Any help so that I could test this, would be welcomed.

Thanks

José
 

thedesolatesoul

Expert
Licensed User
Longtime User
hello icefairy333,
Nice work with the library and thanks for the source.
I am trying to import the source into eclipse but I get weird errors as if some reference is missing.
I was wondering to solve the Nexus 7 front camera problem. In your CameraManager class, in the openDriver method, I think we need to do the following:

B4X:
      cameraId = findFrontFacingCamera();
      if (cameraId < 0) {
        Toast.makeText(this, "No front facing camera found.",
            Toast.LENGTH_LONG).show();
      } else {
        camera = Camera.open(cameraId);
      }

 private int findFrontFacingCamera() {
    int cameraId = -1;
    // Search for the front facing camera
    int numberOfCameras = Camera.getNumberOfCameras();
    for (int i = 0; i < numberOfCameras; i++) {
      CameraInfo info = new CameraInfo();
      Camera.getCameraInfo(i, info);
      if (info.facing == CameraInfo.CAMERA_FACING_FRONT) {
        Log.d(DEBUG_TAG, "Camera found");
        cameraId = i;
        break;
      }
    }
    return cameraId;
  }

Can you build a lib version with this?
Thanks
 

NJDude

Expert
Licensed User
Longtime User
Ok, close but not cigar.

On the Nexus 7 now I see a blinking red line but no camera, also, the orientation, changing the scanner orientation on the Manifest from landscape to portrait works but the scanning doesn't work, this is not only on the Nexus 7.
B4X:
AddApplicationText(<activity android:name="ice.zxing.CaptureActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden">
</activity>)

Also, to get it on landscape or portrait the manifest and the line below must be updated:
B4X:
zx.isportrait = False

Question, would be possible to determine if the device has a front and back cameras? that will be great.

Thanks
 

icefairy333

Active Member
Licensed User
Longtime User
no idea.
:sign0161:
 

icefairy333

Active Member
Licensed User
Longtime User
I like your solution and would like to implement it, but is this legal?
Haven't you used elements from the Zxing sourcecode to create your library? How else would this be possible....

zxing source licences:
B4X:
  "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…