Androidプロジェクトの基礎XML

2476 ワード


res.layout.main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"  
    android:orientation="vertical"            or
    android:orientation="horizontal"        

    android:layout_width="fill_parent"            or
    android:layout_width="wrap_content"            

    android:layout_height="fill_parent"           or
    android:layout_height="wrap_content"            
    >

<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 

    android:text="@string/hello"  TextView       ,            ,
          ,     strings.xml         hello     

    />
</LinearLayout>

res.values.strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hello World, HelloWorld!</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.xserver.hello"        
      android:versionCode="1"          
      android:versionName="1.0">          

          application,          
    <application android:icon="@drawable/icon" android:label="@string/app_name">

    activity        
        <activity android:name=".HelloWorld"
                  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>

  //SDK       
    <uses-sdk android:minSdkVersion="9" />
</manifest>