FileDocCategorySizeDatePackage
MorseCode.javaAPI DocAndroid 1.5 API3285Wed May 06 22:41:08 BST 2009com.example.android.apis.os

MorseCode

public class MorseCode extends android.app.Activity

App that vibrates the vibrator with the Morse Code for a string.

This demonstrates the {@link android.os.Vibrator android.os.Vibrator} class.

Demo

OS / Morse Code Vibrator

Source files

src/com.example.android.apis/os/MorseCode.java The Morse Code Vibrator
res/any/layout/morse_code.xml Defines contents of the screen

Fields Summary
private static final String
TAG
Tag string for our debug logs
private android.widget.TextView
mTextView
Our text view
View.OnClickListener
mClickListener
Called when the button is pushed
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)
Initialization of the Activity after it is first created. Must at least call {@link android.app.Activity#setContentView setContentView()} to describe what is to be displayed in the screen.


    

                                    
    
	   
    
        // Be sure to call the super class.
        super.onCreate(savedInstanceState);

        // See assets/res/any/layout/hello_world.xml for this
        // view layout definition, which is being set here as
        // the content of our screen.
        setContentView(R.layout.morse_code);

        // Set the OnClickListener for the button so we see when it's pressed.
        findViewById(R.id.button).setOnClickListener(mClickListener);

        // Save the text view so we don't have to look it up each time
        mTextView = (TextView)findViewById(R.id.text);