Search code examples
androidjarlibrarieszxingbarcode-scanner

Application Using Barcode scanner without Library Project


I have seen many questions regarding this but none gave me the Result so i am posting this.

I am using GITHUB Barcode Scanner Plugin Everything works fine

What i want now?

  1. I don't want the library project to be referred to my Hybrid Application.
  2. If i don't do that i have error in my project and i cant build my android project.
  3. Is there any work around ( i tries converting the whole library into a jar file and add it to my hybrid project but same error comes)
  4. I have seen some post saying we can do this but these post are done for native andorid application which don't suite me Embed Zxing library without using Barcode Scanner app

The error which i get While not attaching the library is in my Main.java file i use R.sting.close and R.string.error which says me to import 'R' from com.google.zxing.client.android.


Solution

  • I don't know what I am doing is right or wrong,but it worked for me perfectly.

    1. I just copied and appended the files in the res folder of my barcode application with the files in the res folder of my Hybrid application
    2. I had taken the Captureactivity.jar file in the bin folder of the barcode application and placed it in the libs folder of my hybrid application
    3. modified config.xml file in my hybrid application with the appropriate plugin reference,
    4. copied the com-->phonegap-->plugins-->bacodescanner-->barcodescanner.java in the src folder.
    5. run the android project.