Product information Retriever from Barcode

Put your problem here if it does not fit any of the other categories.

Product information Retriever from Barcode

Postby CatalystDroid » Fri Mar 04, 2011 1:40 am

Hello,

I am working on developing an inventory tracking application for android uing zxing barcode scanner integration. The problem I am currently having is providing the product information that zxing is able to display after a scan by querying google products. At least thats how I think that zxing gets the information. Any ideas on how I can implement this. I am able to scan the barcode and get the upc # but how can I then have it return product information from a query to a upc database or google product search?

Any help, insight, ideas would be greatly appreciated. Thanks.

Both parts of code below are part of AddItem.java that extends Activity and implements OnClickListener:


Code: Select all

public void onClick(View v) {
      
      switch (v.getId()) {
      
      case R.id.scanButton:
         Intent intent = new Intent("com.google.zxing.client.android.SCAN");
         intent.putExtra("SCAN_MODE", "PRODUCT_MODE");
         startActivityForResult(intent, REQUEST_BARCODE);
         break;
      
      case R.id.addButton:
          String barcode = mBarcodeEdit.getText().toString();
          String format = mFormatEdit.getText().toString();
          String title = mTitleEdit.getText().toString();
          String price = mPriceEdit.getText().toString();
         
          String errors = validateFields(barcode, format, title, price);
          if (errors.length() > 0) {
              showInfoDialog(this, "Please fix errors", errors);
          } else {
              mItemData.barcode = barcode;
              mItemData.format = format;
              mItemData.title = title;
              mItemData.price = new BigDecimal(price);

              mItemDb.insert(mItemData);
              showInfoDialog(this, "Success", "I saved successfully");
              resetForm();
          }
          break;

      
      }
      
   }


Code: Select all

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
      

if (requestCode == REQUEST_BARCODE) {
   
   if (resultCode == RESULT_OK) {
      
      String barcode = intent.getStringExtra("SCAN_RESULT");
      
      mBarcodeEdit.setText(barcode);
      
      String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
      
      mFormatEdit.setText(format);
      
   }
   
   else if (resultCode == RESULT_CANCELED) {
      
      finish();
      
      
      }

   }
}

User avatar
CatalystDroid
Junior Developer
Junior Developer
 
Posts: 13
Joined: Wed Jan 12, 2011 3:36 am

Top

Re: Product information Retriever from Barcode

Postby Thomassunshine » Sun Feb 17, 2013 8:18 am

Here is a sample code:
using BusinessRefinery.Barcodes.Reader;
// Read a Code 39 barcodes image in C# class
string[] barcodes = BarCodeReader.scanBarCode
(bmp,BusinessRefinery.Barcodes.Reader.BarCodeType.CODE39);
// Read Data Matrix barcodes in C# class
string[] barcodes = BarCodeReader.scanBarCode
(bmp,BusinessRefinery.Barcodes.Reader.BarCodeType.DATAMATRIX);

But i use barcode reader for .net , i do not know whether the code is available or not in your project.
Thomassunshine
Freshman
Freshman
 
Posts: 3
Joined: Fri Jan 18, 2013 9:01 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 12 guests