Barcode scanner, offline (no internet connection needed)

Search This thread

sensboston

Recognized Developer
Nov 18, 2009
2,143
797
193
Boston, MA
Hi guys.

Who wanted a free barcode scanner? Here we are...

No network connection needed; app based on zxing library and Kevin Marshall's (from Clarity Consulting, can't remember his blog url now) code.

I just slightly modified the original code and added a few (probably useful but not sure ;) ) services.

App interface is very simple: run application, focus on barcode, and wait until code is recognized. Touch handset screen to run recognition again.

Buttons description:
- "Save" saves captured barcode to jpeg;
- "Bing" and "Google" used for barcode web lookup (probably this part needs more work)
- "Mail" and "SMS" used for sending recognized code text.

Enjoy!

UPDATE 1: v 1.1, auto focus added;

UPDATE 2: v 1.2, orientation-less UI added, project moved to opensource at googlecode: http://code.google.com/p/barcodescan/

UPDATE 3: v 1.2.1, slightly changed autofocus logic, now works better on HTC. Download link: http://barcodescan.googlecode.com/files/BarcodeScanner.xap

UPDATE 4: v 1.2.2
- barcode search improved;
- added HTC detection, changes in autofocus logic;
http://barcodescan.googlecode.com/files/BarcodeScanner_1.2.2.xap
 

Attachments

  • BarcodeScanner.xap.zip
    116.8 KB · Views: 4,664
Last edited:

davux

Retired Recognized Developer
Aug 5, 2010
105
33
0
Hi guys.

Who wanted a free barcode scanner? Here we are...

No network connection needed; app based on zxing library and Kevin Marshall's (from Clarity Consulting, can't remember his blog url now) code.

I just slightly modified the original code and added a few (probably useful but not sure ;) ) services.

App interface is very simple: run application, focus on barcode, and wait until code is recognized. Touch handset screen to run recognition again.

Buttons description:
- "Save" saves captured barcode to jpeg;
- "Bing" and "Google" used for barcode web lookup (probably this part needs more work)
- "Mail" and "SMS" used for sending recognized code text.

Enjoy!

I can't seem to get it to do anything. It says 'Scanning...' and I'm trying different distances to codes, but nothing ever happens. Any pointers?
 

sensboston

Recognized Developer
Nov 18, 2009
2,143
797
193
Boston, MA
OK, lets go through step by step:
- it's not a marketplace app and have no chance to be published 'cause it uses undocumented camera API; you should download and unpack attachment and sideload the app;
- if you can't capture the barcode, try better lighting. Also, move a handset to autofocus camera. In my tests the scanner captured 100% of barcodes: from books, computer part boxes, foodstuff...
- it's not limited to US 'cause (I believe) the barcodes are international. And yes, it's just reads the barcode; however you may bing or google results, in the most cases search engines able to find product/book description or specifications.

It's a very basic scanner; if someone can recommend online API/service to parse barcode value, I can add it to the program (but I really do not want to spend much time for this)
 

malatesta

Senior Member
May 15, 2006
204
0
0
NY
It technically works but the issue is lack of AF or Macro access.

On my Focus, it only works if I scan a barcode off of my PC (do an image search for one) --then it's super fast and quick.

Books, CDs, etc. do not work, regardless of lighting or distance--I suspect because the camera is not trying to AF. Any work around to that?
 

sensboston

Recognized Developer
Nov 18, 2009
2,143
797
193
Boston, MA
I've tested first on HTC Surround - work perfect (I can prove). But you've right about Focus'es bad autofocus (LOL, sound nonsense - "Focus have no autofocus"!).

Will see what I can do... Any other suggestions or wishes (about barcode lookup, UI, etc.)?

P.S. Fixed (reload version from the first post), now working good on Samsung Focus.
 
Last edited:
  • Like
Reactions: malatesta

malatesta

Senior Member
May 15, 2006
204
0
0
NY
I've tested first on HTC Surround - work perfect (I can prove). But you've right about Focus'es bad autofocus (LOL, sound nonsense - "Focus have no autofocus"!).

Will see what I can do... Any other suggestions or wishes (about barcode lookup, UI, etc.)?

P.S. Fixed (reload version from the first post), now working good on Samsung Focus.
Boom.

Working great on Focus now. Nice job. Think I'll try an LG next... bwahaha

As far as changes, no none right now. I'm sure what other apps use for barcode price comparisons--but perhaps a tie into Amazon or eBay would be good. Too bad you can't just jack into ShopSavvy's system with it, lol. If I think of any, will post back.

Edit: Working on LG Quantum too!
 
Last edited:

davux

Retired Recognized Developer
Aug 5, 2010
105
33
0
I've tested first on HTC Surround - work perfect (I can prove). But you've right about Focus'es bad autofocus (LOL, sound nonsense - "Focus have no autofocus"!).

Will see what I can do... Any other suggestions or wishes (about barcode lookup, UI, etc.)?

P.S. Fixed (reload version from the first post), now working good on Samsung Focus.

hmm, 1.0 wasn't upside down, but 1.1 is upside down on my Focus. Anyone else see this?
 

davux

Retired Recognized Developer
Aug 5, 2010
105
33
0
Hi guys.

Who wanted a free barcode scanner? Here we are...

No network connection needed; app based on zxing library and Kevin Marshall's (from Clarity Consulting, can't remember his blog url now) code.

Enjoy!

UPDATE: v 1.1, auto focus added;

Do you have any interest in releasing the source? I may have some time to improve upon this a bit, but I'd rather not start from scratch (or step on any toes re-creating virtually the same thing).

Nope. Fine on my Focus. It does work with accelerometer, you sure that isn't it?

Good call, I was holding it strangely every time I opened it before. It works great. :)
 

sensboston

Recognized Developer
Nov 18, 2009
2,143
797
193
Boston, MA
Do you have any interest in releasing the source? I may have some time to improve upon this a bit, but I'd rather not start from scratch (or step on any toes re-creating virtually the same thing).

Why not? ;) I'm really do not have time for that project...

Here we are: http://code.google.com/p/barcodescan/

Send me a PM with your gmail and I'll add you to the project contributors. Do not forget comment each commit, increment solution version and promptly build community release (and upload xap to the project's download page!) - and you allset :D

BTW, there are many things to improve: better UI (completely orientation-less), additional functionality - commit found barcodes to database etc. etc. etc.
 
Last edited:

~~Tito~~

Retired Forum Moderator
Jun 30, 2007
3,308
192
203
Please review and follow these rules, it appears you aren't following them, you most likely aren't following the template. So fix it quick :). It is not a harsh criticism, it is just for consistency and better for the user. PM me for help or support!

If this post is here and your thread is closed, it means that you aren't following them and your intentions are for gain only.​

~~Tito~~
 

nepalikhukuri

New member
Sep 3, 2008
1
0
0
problem htc hd7

how do i copy this scanner programme to my htc hd7
i really hate this phone i had a htc touch pro 2 and it was far better can someone help me out here and also if some one can teach me how to customize personal ringtone would be great
 

ajhvdb

Senior Member
Nov 23, 2009
566
12
0
Thx for the code. Really usefull to learn from this :)

Sometimes when you scan a barcode and touch the screen to start again. After a few seconds it stops and shows the last barcode again.

It looks like the UI thread is catching up scanning some images. How to get rid of this?
 

sensboston

Recognized Developer
Nov 18, 2009
2,143
797
193
Boston, MA
It looks like the UI thread is catching up scanning some images. How to get rid of this?

Sorry, I don't have a time for that application now but it should be significantly refactored.If you want you may join the project and continue development, we can share some ideas for app improvement etc.

As for problem u described, you should play with the different capture resolutions or give some hardcoded "pause" to recognition library :) Also, MS camera API (still not officially allowed) is not documented and very poor... However it's a great field for experiments and hacks :)
 

~~Tito~~

Retired Forum Moderator
Jun 30, 2007
3,308
192
203
Please review and follow these rules, it appears you aren't following them, you most likely aren't following the template. So fix it quick :). It is not a harsh criticism, it is just for consistency and better for the user. PM me for help or support!

If this post is here and your thread is closed, it means that you aren't following them and your intentions are for gain only.​

~~Tito~~

Please follow up on this!
 

ajhvdb

Senior Member
Nov 23, 2009
566
12
0
Sorry, I don't have a time for that application now but it should be significantly refactored.

Im not that experienced in multiple threads. Do you think the problem is in the Zxing lib?

Looking at the code the Zxing lib should have a completed event from which you can restart or show the image.

This code works but is racing and racing in the UI thread and after finding a barcode and restarting it looks like something from a buffer is used..

Code:
private void GrabFrame()
		{
			Dispatcher.BeginInvoke(() =>
			{
				if (_Camera != null && CameraVisualizer.Visibility == Visibility.Visible)
				{
					WriteableBitmap wb = new WriteableBitmap(640, 480);

					_Camera.GetCurrentFrame(wb);

					wb.Invalidate();
					ScanBarcode(wb);
					wb.DisposeIfPossible();
				             GrabFrame();
				}
			});
		   
		}
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Hi guys.

    Who wanted a free barcode scanner? Here we are...

    No network connection needed; app based on zxing library and Kevin Marshall's (from Clarity Consulting, can't remember his blog url now) code.

    I just slightly modified the original code and added a few (probably useful but not sure ;) ) services.

    App interface is very simple: run application, focus on barcode, and wait until code is recognized. Touch handset screen to run recognition again.

    Buttons description:
    - "Save" saves captured barcode to jpeg;
    - "Bing" and "Google" used for barcode web lookup (probably this part needs more work)
    - "Mail" and "SMS" used for sending recognized code text.

    Enjoy!

    UPDATE 1: v 1.1, auto focus added;

    UPDATE 2: v 1.2, orientation-less UI added, project moved to opensource at googlecode: http://code.google.com/p/barcodescan/

    UPDATE 3: v 1.2.1, slightly changed autofocus logic, now works better on HTC. Download link: http://barcodescan.googlecode.com/files/BarcodeScanner.xap

    UPDATE 4: v 1.2.2
    - barcode search improved;
    - added HTC detection, changes in autofocus logic;
    http://barcodescan.googlecode.com/files/BarcodeScanner_1.2.2.xap
    1
    I've tested first on HTC Surround - work perfect (I can prove). But you've right about Focus'es bad autofocus (LOL, sound nonsense - "Focus have no autofocus"!).

    Will see what I can do... Any other suggestions or wishes (about barcode lookup, UI, etc.)?

    P.S. Fixed (reload version from the first post), now working good on Samsung Focus.
    1
    Sorry, agree 100% but I just don't have time for that app (hardworking on the real interesting stuff for wp7 ;) )
    BTW, app is opensource and everybody are welcome to join. As a good start point I may recommend Android app "Barcode scanner", it will take about couple of days to implement 90% of functionality.

    Thanks for reply. I've made the modification myself. Now there is "Open" button which is enabled only if you scan a URL.
    1
    This App is open source (but C#, not VB): http://code.google.com/p/barcodescan/source/browse/

    Maybe this website will help you to convert: http://www.developerfusion.com/tools/convert/csharp-to-vb/
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone