Help embedding zxing in my android app

632 views
Skip to first unread message

Malren

unread,
Jan 9, 2012, 1:20:51 PM1/9/12
to zxing
Hi,

I am new with java/android developing and I am working on a new idea
of mine for an android application.

In my application I need a barcode scanner and from a short research I
understand that ZXING is what I am looking for, now I understand that
there are several ways of implementing the ZXING barcode scanner in
applications but what I am looking for is a solution that the end-user
would not notice that I am using a external application or need to
install a "barcode scanner" app. Lets say I want a function that when
i call it the camera of the phone opens (the user can see the camera
screen), detects a barcode and the return the barcode string.
how do I implement this?

Thank you very much,
Jon

Jalp Bhatt

unread,
Jan 10, 2012, 1:29:01 AM1/10/12
to zxing
Hey jon ,

I do the same work here and this is working properly for me . I put a
button on my app and when anyone clicks that then it opens the barcode
scanner and return the results successfully.

For that you have to follow some steps :

1. you download the zxing library and you have to extract the core
folder/core.jar from it. For the guideline i attach here link so you
can do it accordingly.

Link : http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/

In this link you follow up to Three steps ...

2. After creating the core.jar you open that android folder of zxing
library into eclipse and add that jar file into your project .

3.Now it's all set for you .. Further as per your requirements you can
use this app's activity in your code. I recommend you to use the
capture activity to do the job. Not use .Scan activity.

Sean Owen

unread,
Jan 10, 2012, 4:14:48 AM1/10/12
to zx...@googlegroups.com
No, you do not copy android/. I want to be clear that copying and pasting this code is strongly discouraged, and releasing an app so visually similar goes against trademark law even.

If you are not experienced enough to build your own app, you can't build your own app. Integrate via intent: http://code.google.com/p/zxing/wiki/ScanningViaIntent
That alone is not a justification for copying and pasting.

If you want to not rely on a third-party app, and I completely understand that, you need to write your own app, and you are best off starting from scratch. The steps are:
  1. Write your whole app in terms of a SurfaceView, everything except barcode scanning
  2. Add core.jar
  3. Hook up scanning to your SurfaceView by referring to and reusing bits of android/


Aqua Mesh

unread,
Jan 19, 2012, 11:09:13 AM1/19/12
to zxing
Sean,

I do not have surfaceview on anything...can I still make an app using
a barcode scanner without surfaceview?

On Jan 10, 4:14 am, Sean Owen <sro...@gmail.com> wrote:
> No, you do *not *copy android/. I want to be clear that copying and pasting
> this code is strongly discouraged, and releasing an app so visually similar
> goes against trademark law even.
>
> If you are not experienced enough to build your own app, you can't build
> your own app. Integrate via
> intent:http://code.google.com/p/zxing/wiki/ScanningViaIntent
> That alone is not a justification for copying and pasting.
>
> If you want to not rely on a third-party app, and I completely understand
> that, you need to write your own app, and you are best off starting from
> scratch. The steps are:
>
>    1. Write your whole app in terms of a SurfaceView, everything except
>    barcode scanning
>    2. Add core.jar
>    3. Hook up scanning to your SurfaceView by referring to and reusing bits
>    of android/

Sean Owen

unread,
Jan 19, 2012, 5:19:42 PM1/19/12
to zx...@googlegroups.com
How are you showing what the camera sees then? I am sure you do. If you aren't sure on this point, I think you should stick to Intent-based integration.

Sean Owen

unread,
Jun 22, 2012, 4:46:32 AM6/22/12
to zx...@googlegroups.com
Portrait is not supported in Barcode Scanner. You can integrate via Intent with Barcode Scanner+, which does, but it is a for-pay app. https://play.google.com/store/apps/details?id=com.srowen.bs.android

Reply all
Reply to author
Forward
0 new messages