Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@realrasengan
Created July 25, 2012 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save realrasengan/3174001 to your computer and use it in GitHub Desktop.
Save realrasengan/3174001 to your computer and use it in GitHub Desktop.
Bitcoin Balance
var Barcode = require("ti.barcode");
Barcode.addEventListener('success', function (e) {
Ti.Platform.openURL("http://blockexplorer.com/address/"+unescape(e.result).match(/([^\?]*)/)[1].replace("bitcoin:",""));
self.close();
var activity = Titanium.Android.currentActivity;
activity.finish();
});
Barcode.capture({
animate: false,
showCancel: false,
showRectangle: true,
keepOpen: false,
acceptedFormats: [
Barcode.FORMAT_QR_CODE
]
});
var self = Ti.UI.createWindow({
backgroundColor:'#000000',
exitOnClose:true
});
self.addEventListener('android:back', function(e){
self.close();
var activity = Titanium.Android.currentActivity;
activity.finish();
});
self.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment