bardecode.com
barcode reading software
  • Home
  • Download
  • Purchase
  • SDK Licensing
  • Pricing
    • Windows SDK Price List
    • Windows SDK with PDF Extension Price List
    • Linux SDK Price List
    • Linux SDK with PDF Extension Price List
    • PDF Extension For Windows Price List
    • Multi-Platform Toolkit for .NET Price List
    • BardecodeFiler Desktop Only Price List
    • BardecodeFiler Windows Service Price List
    • DOS Command Prompt Barcode Tool Price List
    • Terms and Conditions
    • Refund Policy
  • Products
    • Softek Barcode Reader Toolkit for Windows
    • Softek Barcode Reader Toolkit for Linux
    • BardecodeFiler Desktop App
    • BardecodeFiler Windows Service
    • Windows DOS Command Prompt Tool
    • Multi-platform barcode reader toolkit for .NET
    • Aquaforest’s Autobahn DX
  • Knowledge Base
    • Documentation
    • Specifications
  • News
  • Contact
    • About Us
    • Terms and Conditions
    • Resellers
    • Links
Select Page ...

News

Android Barcode Reading - Quick Start Guide

admin November 27, 2012 Software Development Kits No Comments

So what’s the easiest way to integrate barcode reading into your app?

Whilst it’s possible to integrate the Softek Barcode Reader into your Android app through our java class and jni library, it’s also possible to simply call our Bardecoder app direct from your own app with a minimal amount of work.

The following article describes how to call our Bardecoder Android app from your application, read a barcode and return the barcode value to your own app.

Step 1

Download the Bardecoder app to your phone from the Android Market:

https://market.android.com/details?id=com.softeksoftware.bardecoder

Step 2:

Add the following code to your project where you want to launch the Bardecoder app:

Intent myIntent; myIntent = new Intent();
myIntent.setComponent(new ComponentName("com.softeksoftware.bardecoder", "com.softeksoftware.bardecoder.scanner"));
myIntent.putExtra("com.softeksoftware.bardecoder.scanner.settings", "MY XML SETTINGS - SEE BELOW");
myIntent.putExtra("com.softeksoftware.bardecoder.scanner.finishOnSuccess", true);
myIntent.putExtra("com.softeksoftware.bardecoder.scanner.vibrateOnSuccess", true);
myIntent.putExtra("com.softeksoftware.bardecoder.scanner.beepOnSuccess", true);
myIntent.putExtra("com.softeksoftware.bardecoder.scanner.licenseKey", "MY LICENSE KEY - SEE BELOW");
try {
	startActivityForResult(myIntent, 0); 
}
catch(ActivityNotFoundException ex) {
	bardecode.this.t.setText("Please install the Bardecoder app on your phone");
}

 

Step 3:
Add the following function to collect the results of the barcode scanning:
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
    super.onActivityResult(requestCode, resultCode, data);
    if (data != null)
    {
            Bundle bundle = data.getExtras();
            // Get the value of the bar-code
           // The bar-code type is also available in the key “com.softeksoftware.bardecoder.scanner.type”
            value = bundle.getString(“com.softeksoftware.bardecoder.scanner.value”);
            if (value != null)
            {
            // Do something with value
            }
        }
    }
}
MY XML SETTINGS
The XML settings allow you to control features of the barcode reader toolkit such as which barcodes to read. For example, if you want to read QRCodes and DataMatrix barcodes then include the following text in your settings string:
<ReadQRCode>1</ReadQRCode><ReadDataMatrix>1</ReadDataMatrix>
Example code:
myIntent.putExtra("com.softeksoftware.bardecoder.scanner.settings", "<ReadQRCode>1</ReadQRCode><ReadDataMatrix>1</ReadDataMatrix>");
Download the manual to get the full list of properties that can be set in this way.

 

MY LICENSE KEY
You can get a free 30-day license key for the SDK by emailing sales@bardecode.com
← Common error when using the COM object
Reading barcodes with Real Studio →
admin

  • Copyright © 2023 Softek Software Ltd. All Rights Reserved