Labs Experimental Zone


Barcodes2d - Using 2d Barcodes to Trigger Mediascape Actions

2d barcodes are similar to the kind of barcodes that you may find on a tin of beans in a supermarket, except that they contain data arranged over two dimensions rather that just the one. This means that a lot more data can be stored in 2d barcode than a traditional 1d version, for instance an entire URL can be embedded easily. The Barcodes2d object allows mediascapes to include this exciting new technology as part of the experience. Most Windows Mobile 5 or above devices that contain a built-in camera should be compatible with this object.

2dbarcode reading2dbarcode.jpg
Example of a 2d Barcode Reading a 2D Barcode using an HP iPAQ 6815

Characteristics

Interaction Model

In order to read a 2d barcode as part of a mediascape, the user will need to activate the code reader. This may be done by pressing a button, tapping the screen, or via another interaction that the designer of the mediascape has deemed appropriate. The screen of the device will then switch over to a video feed from the camera. The user must aim the camera at the barcode so that it fills enough of the screen for the system to be able to read the code. Once the code has been successfully read, the mediascape action associated with that code it activated, such as playing some audio or showing an image etc. The system also has the notion of pop-up text - this is a string of text that will appear on the code reading screen during the time that the camera is over a code. This is often used as a way of telling the user what will happen if they were to activate the code.

Range

The exact range depends on the physical size of the code, the amount of data that is and the optics of the camera. For a code of around 3 inches square, containing the text 'this is a test' a iPAQ 6815 will need to be around 15-20 cm away.

Latency

The complete process from deciding to read a code to the associated action occurring is a few seconds for a practised user, and rather longer for a first time user. In general it it probably best to avoid designing a system where many codes must be read in quick succession.

Hardware

Provided that your mediascape device has a built in camera and runs Windows Mobile 5 or above, no extra hardware is required.

Click the link below to view the compatibility chart that lists which mobile devices are compatible with the 2dBarcodes system.

HELP Mobile Device Compatibility Chart

The 2d Barcodes themselves can be generated and downloaded in a couple of different ways, see Generating 2d Barcodes below for details.

Using 2dBarcodes in mscape maker

To add to 2d Barcode capability to your mediascape, you should add the Barcodes2d object.

The Barcodes2d object has two events, OnCodeRead and OnCodeLost which are triggered when a barcode is read, and a few seconds after a barcode cannot be read any more respectively. The Timeout property on the Barcodes2d object is used to set the exact length of time after a code cannot be seen until the OnCodeLost event is triggered. These events are useful when you do not know at the time you are building the mediascape which barcodes will be encountered during the running of your mediascape. Both of these events have a parameters 'URI' and 'PopupText' which contains the URI and pop-up text embedded in the 2d barcode respectively.

Generating 2d Barcodes

2d Barcodes can be read either from the printed page, or even directly off a computer screen. To generate your own custom 2d barcodes, you can use one of the services that we provide.

Using mscape maker (recommended)

mscape maker has the capability to generate codes once the 2dBarcodes object has been added.

generatebarcode.png
The Generate Barcode screen in mscape maker

Note that this function connects to our barcode generation system on the internet, so net access is required. If you access the internet through a proxy, ensure that it is set up correctly in Internet Explorer.

In general, it is best to have the minimum possible amount of data in the barcode, as more text will result in a denser barcode which is in turn more difficult for the barcode reader software to process.

Using the ActivePrint Website

It is possible to generate codes using the ActivePrint Code Generation Page.

Example

This example will show the webpage embedded in a barcode if the URI starts with http:// and will play an audio if the URI is "playASound".

Place the following code into the Buttons object's OnCenter event.

Barcodes2D.Start();
This enables the user to start the barcode reading process by pressing the central cursor button on their device.

This code should go in the Barcodes2d' OnCodeRead event, and requires that the WebPages object (right-click on Media and select Add Web Pages) and an audio called myAudio are in the mediascape.

Barcodes2D.Stop();
if (URI.StartsWith("http://"))
{
   WebPages.LoadUrl(URI);
}
else if (URI == "playASound")
{
   myAudio.Play();
}
Once a code has been read the barcode reading process is stopped. The user will need to press the central cursor button again to restart it.

Using Barcode2d Object in mscape maker

If you do know in advance the contents of the barcodes that will be used in your mediascape you may find it useful to use the Barcode2d object. This object is a child of Barcodes2d, and essentially allows you to associate an OnEncountered and OnLost event with a known Bluetooth name.

Unlike most other sensors, the Barcodes2d object must be explicitly set to read mode before any barcodes can be read.

To do this, use the Barcodes2D.Start(); function. This function is commonly assocated with a button on the device, which is achived using one of the events on the mediascape's Buttons object such as OnCenter.

By default, the code reader will stay active once a code has been read. If this is not the behaviour you require, you could use the Barcodes2D.Stop(); function in the Barcodes2D.OnCodeRead event. This will stop the code reader as soon as any code has been read.

Setting up mscape player to use Barcodes2d

Barcodes2d should not require any setup on mscape player. If your device has a compatible camera, and the Barcodes2D.Start(); call has been made in your script then the video feed should appear. If your device does not have a compatible camera, then you may get an error message. No COM PORT setup is required for Barcodes2d.

NEW Fix for rotated or inverted video feeds

Some devices will display the video feed reversed or rotated. If this happens to you then you can either wait for version 2.2 experimental release, or if you want it fixed right now you can apply the patch below.

exe HP.Easel.Experimental-CF.dll


HELP If you have any comments or queries concerning the information on this page please use the mscape experimental forums

Ready to
get started?

Download Mscape Suite Version 2.6 | 11 MB

Download Mscape Experimental

Experimental Beta Version 2.6 | 11 MB

Ask the Mscape Community

Forums