| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
編集の要約なし
==Android Notepad チュートリアル==
[[Android][Java][Eclipse]]
*http://developer.android.com/resources/tutorials/notepad/index.html
=====すべての Android のXMLレイアウトのヘッダーは以下で始まらなければいけない=====
<&lt;?xml version="1.0" encoding="utf-8"?>&gt;.
=====次に、たいていの場合、以下の様なレイアウトを置く=====
LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
===LinearLayout ===
<&lt;?xml version="1.0" encoding="utf-8"?>&gt; <&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">&gt; <&lt;ListView android:id="@android:id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>&gt; <&lt;TextView android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no_notes"/>&gt; <&lt;/LinearLayout>&gt;
===行のレイアウト===
====notes_row.xml====
*res/layout に notes_row.xml を作成
<&lt;?xml version="1.0" encoding="utf-8"?>&gt; <&lt;TextView android:id="@+id/text1"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>&gt;
===Notepadv1 クラスの編集===
*fillData() はまだ未作成
====onCreateOptionsMenu()====
<&lt;?xml version="1.0" encoding="utf-8"?>&gt; <&lt;resources>&gt; <&lt;string name="app_name">&gt;Notepad v1<&lt;/string>&gt; <&lt;string name="no_notes">&gt;No Notes Yet<&lt;/string>&gt; <&lt;string name="menu_insert">&gt;Add Item<&lt;/string>&gt; <&lt;/resources>&gt;
===AndroidManifest.xml の編集===
*<&lt;activity android:name=".NoteEdit"><&gt;&lt;/activity>&gt;を追加
<&lt;activity android:name=".Notepadv2" android:label="@string/app_name">&gt;
:
<&lt;/activity>&gt; <&lt;activity android:name=".NoteEdit"><&gt;&lt;/activity>&gt;
===ここまでで起動===
if (mRowId == null) {
long id = mDbHelper.createNote(title, body);
if (id > &gt; 0) {
mRowId = id;
}

案内メニュー