org.openuat.channel.oob.j2me
Class J2MEAudioChannel

java.lang.Object
  extended by org.openuat.channel.oob.j2me.J2MEAudioChannel
All Implemented Interfaces:
javax.microedition.lcdui.CommandListener, OOBChannel

public class J2MEAudioChannel
extends java.lang.Object
implements OOBChannel, javax.microedition.lcdui.CommandListener

Implements the audio out of band channel for mobile devices.

Author:
Iulia Ion

Field Summary
 
Fields inherited from interface org.openuat.authentication.OOBChannel
AUDIO_CHANNEL, BUTTON_CHANNEL, VIDEO_CHANNEL
 
Constructor Summary
J2MEAudioChannel(javax.microedition.lcdui.Display display, javax.microedition.lcdui.Displayable homeScreen, int volume)
           
 
Method Summary
 void capture()
           
 void commandAction(javax.microedition.lcdui.Command com, javax.microedition.lcdui.Displayable dis)
           
 void decodeAudio(byte[] audiodata)
          Starts the thread that decodes the recorded hapadep sound.
 byte[] finishCapturing()
          Stop the microphone and the recording.
 void handleAudioDecodedText(byte[] retrieved)
          Called by the DecoderThread when decoding of the recorded sound finished.
 void setOOBMessageHandler(OOBMessageHandler messageHandler)
           
 void transmit(byte[] message)
          Encodes the message in audio format and plays it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

J2MEAudioChannel

public J2MEAudioChannel(javax.microedition.lcdui.Display display,
                        javax.microedition.lcdui.Displayable homeScreen,
                        int volume)
Method Detail

commandAction

public void commandAction(javax.microedition.lcdui.Command com,
                          javax.microedition.lcdui.Displayable dis)
Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener

decodeAudio

public void decodeAudio(byte[] audiodata)
Starts the thread that decodes the recorded hapadep sound.

Parameters:
audiodata -

finishCapturing

public byte[] finishCapturing()
Stop the microphone and the recording.

Returns:
the audio sound recorded.

handleAudioDecodedText

public void handleAudioDecodedText(byte[] retrieved)
Called by the DecoderThread when decoding of the recorded sound finished.

Parameters:
retrieved - The decoded content.

setOOBMessageHandler

public void setOOBMessageHandler(OOBMessageHandler messageHandler)
Specified by:
setOOBMessageHandler in interface OOBChannel

transmit

public void transmit(byte[] message)
Encodes the message in audio format and plays it.

Specified by:
transmit in interface OOBChannel

capture

public void capture()
Specified by:
capture in interface OOBChannel


2005-2009, Rene Mayrhofer.