Java Question B4A Library for Honeywell barcode Scanners

Megasoft

New Member
Licensed User
Longtime User
Hi Erel:


I am trying to make one b4a app to Scan bar code with an Android 4 PDA device with barcode scanner (Honeywell dolphin black 15).

The Honeywell manufacturer has an SDK for java that I can use to activate barcode scanner an read many types of barcodes.


Since there is not chance to directly use the java SDK from a B4A project, I have tried to make a B4A library in java to use the SDK and use the library from B4A.

Taking as example the source of b4azxing library and the samples of Honeywell SDK, I made a library with a java class and an android activity.

The java class (HoneywellScanActivity) has a public method (DoScan) which opens the activity with a button. In the activity code I make the call to the Honeywell SDK objects to start the scan. I works perfect. The class DecodeManager of the SDK has a constructor with two parameters, the first one is an Android Context object, the second is the method handler that captures the callback of the DecodeManager doDecode method witch activate the scanner.


I would like to do the same library, but instead of open a new activity that calls the Honwywell API, I would need to call directly the Honeywell API from the first class. I have tried creating one DecodeManager and passing as the first parameter in the constructor the BA object passed from the B4A app. When I do the call to the DecodeManager doDecode method, in the log I receive an error coming from the SDK than indicates there is a null in some internal variable of the SDK, and the scanner does not activate.


I send a zip attachment that contains two folders and one jar file:

The honeywellScan folder has the java project for the b4a lib, that a explain in my first paragraph, the testHonyWellScan is the b4a test project that uses my lib, and the file honeywell.jar is the Honeywell api library.


I think the library could be useful for the people who have this Honeywell devices,


¿can you help me some way to do this?


Thanks a lot
 

Attachments

  • honeywellScan.zip
    158.6 KB · Views: 891

Ron Davey

Member
Licensed User
Longtime User
Hello Megasoft / Erel,

I would like to have access to the Honeywell and Motorola 1D / 2D bar code scanners. I downloaded the zip file from megasoft above, but did not find any library files that I could include in my b4a project.

However, in reading Erel's response is there an easy way to access the scanners using b4a.

Thanks
 

alan dodd

Member
Licensed User
Longtime User
Hi Erel:


I am trying to make one b4a app to Scan bar code with an Android 4 PDA device with barcode scanner (Honeywell dolphin black 15).


Hello, I too am trying to program this Honeywell Dolphin 70e to scan with B4A.
The drivers (SDK) are the same as for dolphin 15.
I tried with JavaObject Library, but I got stuck, as I don't know how to use RunMethod with an Intent as found in the java example in the sdk of Honeywell. (ScanViaIntentSample: RunMethod("startActivityForResult(...??)
Did you manage to solve your problem, and if so, can you share the results?
Thank you.
 

alan dodd

Member
Licensed User
Longtime User
Hello, Erel.
I tried in B4A both examples you pointed me to (ringtone picker and contact picker) and managed to make them work (on the dolphin btw).
But the B4A code for the dolphin scanner I wrote does not work.
I loaded the java honeywell demo 'scanviaintent' with eclipse, compiled and works on the terminal - as I tap the screen it scans the barcode and writes the result. I then wrote the b4a 'equivalent' program in basic ('10scan') using your examples as a guideline; it compiles allright, uploads to the terminal, but when i tap the screen it does not scan (the scanner led does not activate) and on the log it writes every time I tap the screen:

Keep awake on motion by Accel Event
START {act=com.honeywell.scanintent.ScanIntent.SCAN_ACTION (has extras)} from pid 619
** Activity (main) Pause, UserClosed = false **
onActivityResult: wi is null
** Activity (main) Resume **
set_output_volumes(0xfb08): Media: adev->devices=0x40002
out_standby(0x209e8)
do_output_standby(0x209e8)

I send you the sources, as well as the help page of the sdk.
Grateful if you can help
Regards, Alan
 

Attachments

  • ScanViaIntentSample.java.txt
    1.9 KB · Views: 724
  • 10scan.b4a.txt
    2.9 KB · Views: 674
  • ScanIntent.html.zip
    2.8 KB · Views: 519
Last edited:

alan dodd

Member
Licensed User
Longtime User
Try to add the category to the intent.
Thank you for the quick answer. Tried but to no avail.
Does'nt matter. I found another way.
I modified and compiled the java demo code so that it 'replies' to the B4A caller:

B4A caller:

B4X:
Sub ShowPicker
  Dim i As Intent
  i.initialize("com.honeywell.samples.scanviaintent.SCANNIT","")
  StartActivityForResult(i)
End Sub

java responder:

B4X:
@Override
  public void finish()  {
      // Prepare data intent
      Intent data = new Intent();
      data.putExtra("returnKey1", "just a test.. ");
      data.putExtra("returnKey2", value1);
      setResult(RESULT_OK, data);
      super.finish(); 
  }

and then grab it in B4A with:

B4X:
Sub ion_Event (MethodName As String, Args() As Object) As Object
  Dim ii As Int
  'Args(0) = resultCode
  'Args(1) = intent
   If Args(0) = -1 Then
      Dim i As Intent = Args(1)
      Dim id1 As String = i.GetExtra("returnKey1")
      Dim id2 As String = i.GetExtra("returnKey2")
      Label1.Text = id1
      Label2.Text = id2
   End If
   Return Null
End Sub

code added in AndroidManifest.xml:

B4X:
<activity
  android:name=".AnotherActivity"
  android:label="@string/app_name" >
  <intent-filter>
  <action android:name="com.honeywell.samples.scanviaintent.SCANNIT" />
  <category android:name="android.intent.category.DEFAULT" />
  </intent-filter>
  </activity>

I had to create a 2nd activity in the java program, so I could associate it with the unique action android name.
(i found out that the 'main' intent filter must always have the name: "android.intent.action.MAIN")

Thanks in any case, and my compliments for your excellent program, and online doc and service.
Alan
 

FHEBERT

Member
Licensed User
Longtime User
Hello,
I want to change the format of the scanning window. I tried differente library (ABZxing, B4AZxing, ZXing), but none matches with what I want.
(I would like the scanning surface is reduced in height and much larger)

I do not know modify the source code of the ZXing library with eclipse.
So, how do? Would you have a solution for me? :)
thank you very much
 

FHEBERT

Member
Licensed User
Longtime User
I tried to create the library in eclipse from source code.
B4A sends me this when I execute my application on the smartphone.
It seems that I forgot a link to access the class.
See the capture.
Thank you for your help
 

Attachments

  • 2014-10-30_15h17_30.png
    2014-10-30_15h17_30.png
    47.6 KB · Views: 600

JimmyQG

New Member
Licensed User
Longtime User
I am trying to integrate my B4A application with Honeywell SDK. If anybody already done the integration, can you please post the steps you followed?
 
Top