Open Source Android Apps for Developers: Android-pcbcr
Android PC_BCR allows you to use your Android mobile device as a barcode scanner peripheral for your PC. Barcodes that you scan with your mobile device are transfered over a WiFi network connection to the PC.
There are several components to the program. On the mobile device, the PC_BCR program uses the ZXing barcode scanner to scan the barcodes. The program then transfers the data over the network to the PC, where it is received by the PC_BCR program on the PC. This program on the PC can function as either a keyboard wedge scanner, where the barcode data will be typed into whatever editable field has focus (as if it were typed out using the keyboard), or it can also send data to a serial port where it can be consumed by another program on the PC. The PC application uses Mono and GTK#. It supports Windows (as supported by Mono) and any Unix that can run xvkbd and Mono.
# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://android-pcbcr.googlecode.com/svn/trunk/ android-pcbcr-read-only
On the Android device: Install PC_BCR from Android Market (or http://code.google.com/p/android-pcbcr/downloads/list). PC_BCR requires ZXing barcode scanner to be installed on the mobile device as well. If it is not installed the program will prompt you to install it when you first attempt to scan a barcode.
On the PC: – Download the PC_BCR.zip file from http://code.google.com/p/android-pcbcr/downloads/list and extract the contents.
- Next, install Mono and GTK# (Mono 2.6.1 or later and gtksharp 2.12.9 or later)
Windows – download and install Mono with GTK# from http://www.go-mono.com/mono-downloads/download.html.
Linux – install mono, gtk# and xvkbd using your package manager (eg. sudo apt-get install mono-runtime libmono-winforms2.0-cil gtk-sharp2 xvkbd)
- create shortcut
Windows – run ‘setup.exe’ from the location where you extracted to PC_BCR files to create a shortcut in the Start Menu to ‘Android PC_BCR’ for the current Windows user. Depending on your security settings and your version of Windows, you may need to run ‘setup.exe’ as Administrator in order to be able to write to the ‘Program Files’ directory. Note that ‘WindowsPCBCRsetup.exe’, the setup program that creates the shortcut to ‘Android PC_BCR’, requires .NET 2.0 or later. The program will guide you through installing .NET 2.0 if it is not already installed on the system. The setup program will copy ‘PC_BCR.exe’ and related files to the ‘Android PC_BCR’ directory in your ‘Program Files’ (or ‘Program Files (x86)’ on 64 bit) directory.
On the PC: Windows – click on ‘Android PC_BCR’ in the Start Menu programs list.
Linux – navigate to ‘PC_BCR/PC_BCR/bin/Debug’ in the terminal and type ‘mono PC_BCR.exe’.
When PC_BCR launches on the PC it will automatically detect what IP address(es) your computer is using, so in most cases you can just accept what PC_BCR suggested. If you have multiple network connections on your computer PC_BCR will present a dialog box with a list of IP addressses. You should chose the address that corresponds to the network that your Android device is also connected to. The port number doesn’t really matter, you should probably just use the default value unless it doesn’t work for you for some reason. You can see more info on your IP addresses by running ‘ipconfig /all’ in the Windows command prompt, or ‘ifconfig’ in Linux.
Once you have settled on and IP address and port, the next step is to chose what mode you would like the program to work in. It can either function as a keyboard wedge scanner, or as a scanner connected to a serial port. A keyboard wedge scanner acts kind of like a second keyboard, just ‘typing in’ the scanned barcode data into whatever field is currently selected on the PC. So for example you could scan the barcodes into a text editing or spreadsheet program. There are checkboxes for “append ‘Tab’” and “append ‘Enter’”. If one (or both) of the boxes is checked, the corresponding keystroke will be made after the barcode is scanned. ‘Tab’ is useful for moving over a column in a spreadsheet after the barcode is scanned, while ‘Enter’ will move down a row in a spreadsheet, or to a new line in a text editor, after the barcode is scanned.
If you are writing or running another program on the PC, you may want to use the serial port option. On Windows you could install com0com and setup a virtual serial port pair. One end of the pair will connect to PC_BCR, while the other will connect to your other application. As a test, you can connect one end of the pair to PC_BCR and the other to Hyperterminal/PUTTY etc (configured with the proper serial port settings), and the scanned data will appear in your serial terminal program. On Linux I am not aware of a com0com type program, so serial port mode is likely not useful on this OS.
After selecting the IP address, port, and program mode, the next step is to click on the ‘Listen’ button. This will launch a background thread that will monitor the TCP port for incoming data, and when it is received echo it to the local PC according to the selected mode. As data is received you will see it appear in the log window at the top of PC_BCR. You can end the program by just clicking on the close button. The ‘Stop’ button allows you to stop listening for data and possibly change the program’s parameters before starting to listen again.
On the Android device:
Make sure that your mobile device has an active WiFi connection on the same network as the target PC. Run PC_BCR and enter in the target IP address and port. These should match what was entered into the PC side application. Note that you must press the ‘Listen’ button on the PC side application before the Android device will be able to transfer barcode data to the PC. When you click the scan button on the Android device, the ZXing barcode scanner will be launched, and when a barcode is successfully scanned it will be transfered back to the host PC over the WiFi network.
If you want to, you can specify which types of barcodes the scanner will look for. This option is accessed through the ‘Menu’ button. After checking the barcode formats that you are interested in, press the ‘Back’ button to return to the main screen. Note that you need Barcode Scanner version 3.22 or later for these options to work.
There are two scanning modes accessible through the menu: Normal and Continuous Scan. Normal mode requires you to press the Scan button for each barcode that you want to scan, while Continuous mode will keep trying to scan barcodes until you press the ‘Back’ button.
Posted by Cute Android
Related Android Apps:
- Open Source Android Apps for Developers: Zxing
- Open Source Android Apps for Developers: Milestone-overclock
- Open Source Android Apps for Developers: Android-opencv
- Open Source Android Apps for Developers: Openintents
- Open Source Android Apps for Developers: Kwaak3
- Open Source Android Apps for Developers: Open-gpstracker
- Open Source Android Apps for Developers: Quake2Android
- Open Source Android Apps for Developers: Android-mediamanager
- Open Source Android Apps for Developers: Andrico
- Open Source Android Apps for Developers: Forget3d