basic understanding of android xml

9
03. Android XML Oum Saokosal Master of Engineering in Information Systems, South Korea 855-12-252-752 [email protected]

Upload: oum-saokosal

Post on 13-Apr-2017

191 views

Category:

Education


2 download

TRANSCRIPT

Page 1: Basic Understanding of Android XML

03. Android XMLOum Saokosal

Master of Engineering in Information Systems, South Korea855-12-252-752

[email protected]

Page 2: Basic Understanding of Android XML

Agenda

• Basic XML• Explore XML in Android App

Page 3: Basic Understanding of Android XML

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

Page 4: Basic Understanding of Android XML

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”

Page 5: Basic Understanding of Android XML

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>

Page 6: Basic Understanding of Android XML

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>

Page 7: Basic Understanding of Android XML

<?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

Page 8: Basic Understanding of Android XML

Explore GUI Editor

Page 9: Basic Understanding of Android XML

Go on to the next slide