Java Reference
In-Depth Information
Note Android supports up to 16 concurrently executing AVDs. Each AVD is as-
signed an even-numbered console port number starting with 5554.
Creating, Installing, and Running an App
Nowthatyou'veinstalledtheAndroidSDK,installedanAndroidplatform,andcreated
and started an AVD, you're ready to create an app, and install and run this app on the
AVD. This section introduces you to an app named Java7MeetsAndroid . After
presenting and discussing the app's source code and related files, it shows you how to
create this app, and install and run it on the previously started AVD.
Introducing Java7MeetsAndroid
Java7MeetsAndroid is a single-activity app that presents an image and a button.
TheimageshowsDuke,theJavamascot,overaglowing7.Thebutton,labeledWave,
starts an animation of Duke waving when clicked.
Note Check out “Duke, the Java mascot” ( http://kenai.com/projects/
duke/pages/Home ) to learn more about this cool character.
Listing 12-3 presents the Java7MeetsAndroid class.
Listing 12-3. An activity for making Duke wave
package ca.tutortutor.j7ma;
import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
public class Java7MeetsAndroid extends Activity
Search WWH ::




Custom Search