android create project --package com.example.helloandroid --activity HelloAndroid --target 2 --path ./HelloAndroid
tee ./HelloAndroid/src/com/example/helloandroid/HelloAndroid.java <<-EOF
package com.example.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
EOF
android list avd
emulator -avd XXXXX &
cd ./MyProject
adb devices
ant install
adb shell 'am start -n com.example.helloandroid/.HelloAndroid'