basic understanding of android xml
TRANSCRIPT
03. Android XMLOum Saokosal
Master of Engineering in Information Systems, South Korea855-12-252-752
Agenda
• Basic XML• Explore XML in Android App
Basic XML (1) <?xml version="1.0"?><student> <id>N001</id> <name>Thy Vanna</name> <major>IT</major></student><student> <id>N002</id> <name>Sok Chenda</name> <major>IT</major></student>
student
id=N001
name=ThyVana
major=IT
student
id=N002
name=Sok Chenda
major=IT
Basic XML (2)<?xml version="1.0"?><student id=“N001” name=“Thy Vanna” major=“IT” ></student><student id=“N002” name=“Sok Chenda” major=“IT” />
student
id=“N001”
name=“Thy Vanna”
major=“IT”
student
id=“N002”
name=“Sok Chenda”
major=“IT”
Explore XML in Android App
string.xml
<?xml version="1.0" encoding="utf-8"?><resources> <string name="hello">Hi there. This is Kosal. My
App. </string>
<string name="app_name">HelloWorld</string></resources>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.kosalab" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon"
android:label="@string/app_name"> <activity android:name=".WidgetContainer" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name=
"android.intent.category.LAUNCHER" /> </intent-filter> </activity>
</application> <uses-sdk android:minSdkVersion="5" />
</manifest>
<?xml version="1.0" encoding="utf-8"?><LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" >
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="@string/hello" />
<ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/icon"
/></LinearLayout>
main.xml
Explore GUI Editor
Go on to the next slide