HMT Development Examples

Development Example – Barcode Applet

The HMT barcode application can be used by third party applications.

These applications can launch the barcode application which will ask the user to scan a barcode. The data from the captured barcode will be returned to the calling application.

Launch Barcode Scanner

 private static final int RequestCode = 1984; 

private static final String ACTION_BARCODE =
private static final String EXTRA_RESULT =


Intent intent = new Intent(ACTION_BARCODE);
startActivityForResult(intent, RequestCode);

Listen for barcode scan result

 protected void onActivityResult(int requestCode, int resultCode, Intent data) { 
if (resultCode == Activity.RESULT_OK && requestCode == RequestCode) { 
String result = "[No Barcode]"; 
if (data != null) { 
result = data.getStringExtra(EXTRA_RESULT);


View Full Source Code