Androidプロジェクトのイメージ及び解説

2011/07/08 22:30Update
TAGS: Android | プロジェクト | 開発 | Helloworld

Androidアプリケーションを開発する前に、Androidプロジェクトはどんなイメージであるかを知りたい。

本文はその解説を行います。


◇ MyAndroidActivity:メインクラス(アクティビティ・クラス)
R:自動生成されるファイル。編集しないでください。

◇ layout/main.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"
    />
</LinearLayout>



◇ AndroidManifest.xml
Androidデバイスに実行される必要とするAndroid アプリケーションの構成情報。

◇ AndroidManifest.xmlは自動で作成されたものの、次のようになります。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.syboos.android"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="12" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".MyAndroidActivity"
                  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>
</manifest>

有关作者
Syboos.jp編集長AJavaやオープンソース情報の執筆、Webサイトの開発や運営全般の業務に携わる。

Sponsored Link


Comments

用户名 (required)

Email (will not be published) (required)

URL

Evaluation