Professional Documents
Culture Documents
SDK
Android SDK SDK
Eclipse
Eclipse 3.2,3.3(Europa)
Android ()
IDE
JDK5.0 JDK6.0( JRE )
SDK
SDK zip SDK
$SDK_ROOT $SDK_ROOT/tools
1.Linux ~/.bash_profile ~/.bashrc PATH
$SDK_ROOT/tools PATH
export PATH=${PATH}:<$SDK_ROOT/tools >
2.Mac home .bash_profile Linux
.bash_profile
3.Windows
Path$SDK/tools
$SDK/tools adb
SDK PATH
Eclipse (ADT)
Eclipse Android Android Android
Development Tools(ADT)ADT
Android Android
Eclipse ADT
ADT Eclipse :
1. Eclipse Help > Software Updates > Find and Install....
, "Hello, World"
1, File -> New -> Project "Android Project"
2,
3,
1 Android
Eclipse, File -> New -> Project , Android Eclipse
"Android Project"
Android Project,Next
2, .
:
Project Name:
Package Name: JAVA
"com.google.android",
Activity Name: Android Activity Activity
Application Name:
"""Use default location"
HelloAndroid .
public class HelloAndroid extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.main);
}
}
[]
() View TextView.
TextView:
TexiView tv = new TextView(this);
TextView Android Context , Context ,
,
TextView
: Hello, Android
Android Eclipse Run -> Open Run Dialog
,"Android Application" , ()
"Android Application" ,
"New_configuration".
"Apply" ,
"Run" Android
XML Android
XML
"Hello, World"
View
Android : XML
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Hello, Android"/>
AndroidXML View
, TextView View
View
Web
XML :
layoutmain,
XML R.java R.java
HelloAndroid XML