4

My objective is simple: Read the data from a barcode scanner.

I know that there's an option for scanning the barcode using camera, but in my experience the results are not very accurate in less than ideal situation i.e. bad lighting. So, I'm exploring if an external device can be easily connected with the iPhone/iPad and which can provide the barcode data just like an external keyboard.

So, can I read the barcode, which is scanned using an external device? If so, can I do it without writing any code, or will I have to specifically add some kind of support in my application?

Mustafa
  • 20,504
  • 42
  • 146
  • 209
  • I am using linea pro and it works great. The sdk is easy to use. – Warren P Mar 23 '13 at 01:36
  • @WarrenP Can the Linea Pro work like a keyboard? I'm sitting with one and it doesn't type anything when I scan. It only works together with the app that has been made and is installed. I don't have access to the docs for it yet though... – TheStoryCoder Aug 21 '17 at 02:34

2 Answers2

11

Answer

Any iOS compatible Bluetooth scanner that supports HID mode. For instance, any Socket CHS. Once connected, it will behave exactly as you said "just like an external keyboard".

HID vs SDK

HID: Using any scanner as a keyboard, you are limited to inputting scanned data into open input fields where the user can modify the scanned data and there are limited options for post-processing and validation.

Because the scanner appears to iOS as a keyboard, iOS hides the onscreen keyboard - which makes sense... if the scanner were an actual keyboard. Some scanners (incl. Socket CHS 7Ci & 7Xi) provide a mechanism to force the keyboard (On our CHS double-click the power button) or the app can force the keyboard (see: related stackoverflow questions)

SDK: Developing an app using the SDK provides a more robust setup and handles more complex use cases: Scan into the application even if an input field is not active, enforce a particular scan order (Scan a UPC followed by a VIN number, not vice versa), or parse the scanned data (Breaking a timedate stamp into year, month, day, time).

Conclusion: Personally, I'd use HID mode as a quick and dirty way to get started, but would switch to the SDK for the final product. Obviously, it depends on how much control you need/want.

Disclaimer: I work for Socket Mobile

Community
  • 1
  • 1
Enrico
  • 10,377
  • 8
  • 44
  • 55
  • Thank you for the response. Can you give me an example where I would have to use the SocketScan SDK? – Mustafa Mar 07 '13 at 07:08
  • I've updated my answer to explain the difference between HID and SDK and why one might use the SDK – Enrico Mar 07 '13 at 10:52
  • Right. So HID is a more generic solution, whereas with the use of an SDK I'll get more control... at the expense of more work... to support different scanners. Thank you for taking the time to post the answer. It's exactly what I was looking for. – Mustafa Mar 07 '13 at 11:08
  • Is there a way to toggle between the scanner (HID mode) and soft keyboard, or force the soft keyboard/ device keyboard? When the scanner device is attached, it hides the device keyboard, making it impossible to enter data into other fields... without un-pairing the scanner first. – Mustafa May 31 '13 at 05:18
  • On a Socket CHS you can double tap the power button to toggle the soft keyboard. Other scanners also support toggling the soft keyboard, just check your user's manual. – Enrico Jun 04 '13 at 23:42
  • Thanks Enrico. I was able to get the HID mode working. Now I'm trying to include SDK support. Can you help? Here's the appropriate thread: http://stackoverflow.com/questions/17673981/using-static-library-in-xcode-4-6-x-i-e-koamtac-ios-sdk-integration – Mustafa Jul 17 '13 at 04:38
  • @Enrico Socket scanner works with iOS simulator in SPP mode ? or with Device only ? – Maulik Jun 15 '17 at 08:08
  • @Maulik device only. Unfortunately, [Apple doesn't support Bluetooth in the simulator](https://stackoverflow.com/questions/35586086/how-can-i-switch-on-bluetooth-on-the-ios-simulator). The Android emulator doesn't support Bluetooth either. – Enrico Jun 15 '17 at 14:20
1

You can download the demo from the link

http://www.datecs.bg/en/products/Linea-Pro-iPhone-SDK/8/102

Just run LineaDemo after unzip it. It's scanning using Linea Pro Scanner[External device]

Shah Paneri
  • 729
  • 7
  • 28
  • This doesn't answer my question. Specifically, why do I need the LineaiPhoneSDK to get input from the scanner device -- just like keyboard input? – Mustafa Mar 04 '13 at 13:05
  • You want to scan barcode using external device. So this demo provide scanning facility using Linea Pro Scanner and i have used it also and it's working fine. You just have to attach the scanner and scan barcode. So you will get all data including barcode type also using this. – Shah Paneri Mar 05 '13 at 04:32
  • Thanks, I think I understand now. So, instead of using hardware button on the scanner (device), an iOS application can send the command to scan, and then receive/interpret the response. A simulator with the SDK would have been nice -- for evaluation. – Mustafa Mar 05 '13 at 07:19