Coded while commuting on the android device and then compiled and run on the same android device
[TOC]
src/net/kittyandbear/androidhi/AndroidhiActivity.java
package net.kittyandbear.androidhi;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class AndroidhiActivity extends Activity
{
@Override public void onCreate( Bundle savedInstanceState )
{
super.onCreate( savedInstanceState );
setContentView( R.layout.main );
TextView tv = new TextView( this );
tv.setText( "I lub Bobby!" );
setContentView( tv );
}
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.kittyandbear.androidhi"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".AndroidhiActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>