barcode scanner module for appcelerator titanium
Java Python JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Barcode Scanner For Appcelerator Titanium

This is a small barcode scanner module you can use together with Titanium Appcelerator on an Android device.

Build prerequisites

To build the module, there are some dependencies which need to be fulfilled:

  • Git
  • Titanium Mobile SDK 1.8.1 or above
  • Python >= 2.5
  • Sun Java SDK 6.0
  • Android SDK with Google APIs and SDK version 4 installed
  • Ant >= 1.7.1

Build the module

To build the module, you need to clone our git repository and build the sources with ant:

# clone the repository
git clone
cd titanium-barcode
# run ant to build the module
ant clean && ant

If the build fails, make sure the entries in the buld.properies file point to the right path:

titanium.platform=/Library/Application Support/Titanium/mobilesdk/osx/1.8.1/android

The newly created *.jar and *.zip files can be found in the dist directory. The module you need is called com.mwaysolutions.barcode-android-$

Use the module

  • Build the module or download is from the download section
  • Place it into your appcelerator project directory
  • Add the module to the module section of your tiapp.xml file: com.mwaysolutions.barcode
  • Use it in your application with require('com.mwaysolutions.barcode');
  • Build your project as usual with the Titanium Developer application

The Scanner looks strange on devices with a high resolution screen?!

If the layout of the scanner activity is not centered, add the following entry to your tiapp.xml:

<android xmlns:android="">
        android:anyDensity="true" />

Code Example

var window = Ti.UI.createWindow({

var label = Ti.UI.createLabel();

var titaniumBarcode = require('com.mwaysolutions.barcode');

  success: function (data) {
    if(data && data.barcode) {
      var label = Titanium.UI.createLabel({
        text:'Barcode: ' + data.barcode,
    } else {

  error: function (err) { 
    alert("Error!! " + err); 

  cancel: function () {