Finish adding Makefiles for the Notepad tutorial.
Add the missing makefiles for the non-solution versions of the tutorial
code. Required providing missing imports in Notepadv2. Also standardized
white spaces using Source > Correct Indentation in Eclipse and a few
manual changes. This was done to minimize differences such as:
diff -r Notepadv1 Notepadv1Solution
diff -r Notepadv1Solution/src/com/android/demo/notepad1/ Notepadv2/src/com/android/demo/notepad2/
Change-Id: Ie8b10efd61f2200b3c741ea500a6924710ab54ed
diff --git a/tutorials/NotepadCodeLab/Notepadv1Solution/Android.mk b/tutorials/NotepadCodeLab/Notepadv1Solution/Android.mk
index 5375031..35bc577 100644
--- a/tutorials/NotepadCodeLab/Notepadv1Solution/Android.mk
+++ b/tutorials/NotepadCodeLab/Notepadv1Solution/Android.mk
@@ -17,6 +17,7 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+# Only build apk if this package is added to CUSTOM_MODLUES in buildspec.mk
LOCAL_MODULE_TAGS := optional
# Only compile source java files in this apk.
diff --git a/tutorials/NotepadCodeLab/Notepadv1Solution/res/layout/notes_row.xml b/tutorials/NotepadCodeLab/Notepadv1Solution/res/layout/notes_row.xml
index 6b1a65b..f28a41b 100755
--- a/tutorials/NotepadCodeLab/Notepadv1Solution/res/layout/notes_row.xml
+++ b/tutorials/NotepadCodeLab/Notepadv1Solution/res/layout/notes_row.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
-<TextView android:id="@+id/text1"
- xmlns:android="http://schemas.android.com/apk/res/android"
+<TextView android:id="@+id/text1" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
\ No newline at end of file
+ android:layout_height="wrap_content"/>
diff --git a/tutorials/NotepadCodeLab/Notepadv1Solution/src/com/android/demo/notepad1/NotesDbAdapter.java b/tutorials/NotepadCodeLab/Notepadv1Solution/src/com/android/demo/notepad1/NotesDbAdapter.java
index 6f85bbd..a3295d6 100755
--- a/tutorials/NotepadCodeLab/Notepadv1Solution/src/com/android/demo/notepad1/NotesDbAdapter.java
+++ b/tutorials/NotepadCodeLab/Notepadv1Solution/src/com/android/demo/notepad1/NotesDbAdapter.java
@@ -43,13 +43,13 @@
private static final String TAG = "NotesDbAdapter";
private DatabaseHelper mDbHelper;
private SQLiteDatabase mDb;
-
+
/**
* Database creation sql statement
*/
private static final String DATABASE_CREATE =
- "create table notes (_id integer primary key autoincrement, "
- + "title text not null, body text not null);";
+ "create table notes (_id integer primary key autoincrement, "
+ + "title text not null, body text not null);";
private static final String DATABASE_NAME = "data";
private static final String DATABASE_TABLE = "notes";
@@ -102,7 +102,7 @@
mDb = mDbHelper.getWritableDatabase();
return this;
}
-
+
public void close() {
mDbHelper.close();
}
@@ -158,9 +158,9 @@
Cursor mCursor =
- mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,
- KEY_TITLE, KEY_BODY}, KEY_ROWID + "=" + rowId, null,
- null, null, null, null);
+ mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,
+ KEY_TITLE, KEY_BODY}, KEY_ROWID + "=" + rowId, null,
+ null, null, null, null);
if (mCursor != null) {
mCursor.moveToFirst();
}