summaryrefslogtreecommitdiffstats
path: root/tutorials/NotepadCodeLab/Notepadv1
diff options
context:
space:
mode:
Diffstat (limited to 'tutorials/NotepadCodeLab/Notepadv1')
-rw-r--r--tutorials/NotepadCodeLab/Notepadv1/Android.mk31
-rwxr-xr-xtutorials/NotepadCodeLab/Notepadv1/AndroidManifest.xml3
-rwxr-xr-xtutorials/NotepadCodeLab/Notepadv1/src/com/android/demo/notepad1/Notepadv1.java4
-rwxr-xr-xtutorials/NotepadCodeLab/Notepadv1/src/com/android/demo/notepad1/NotesDbAdapter.java14
4 files changed, 42 insertions, 10 deletions
diff --git a/tutorials/NotepadCodeLab/Notepadv1/Android.mk b/tutorials/NotepadCodeLab/Notepadv1/Android.mk
new file mode 100644
index 000000000..60beb2c82
--- /dev/null
+++ b/tutorials/NotepadCodeLab/Notepadv1/Android.mk
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+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.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := Notepadv1
+
+# Make the app build against the current SDK
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)
diff --git a/tutorials/NotepadCodeLab/Notepadv1/AndroidManifest.xml b/tutorials/NotepadCodeLab/Notepadv1/AndroidManifest.xml
index 33f30da3c..99023fe78 100755
--- a/tutorials/NotepadCodeLab/Notepadv1/AndroidManifest.xml
+++ b/tutorials/NotepadCodeLab/Notepadv1/AndroidManifest.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.demo.notepad1">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.demo.notepad1">
<application android:icon="@drawable/icon">
<activity android:name=".Notepadv1" android:label="@string/app_name">
<intent-filter>
diff --git a/tutorials/NotepadCodeLab/Notepadv1/src/com/android/demo/notepad1/Notepadv1.java b/tutorials/NotepadCodeLab/Notepadv1/src/com/android/demo/notepad1/Notepadv1.java
index 43e7a7733..df73f42d4 100755
--- a/tutorials/NotepadCodeLab/Notepadv1/src/com/android/demo/notepad1/Notepadv1.java
+++ b/tutorials/NotepadCodeLab/Notepadv1/src/com/android/demo/notepad1/Notepadv1.java
@@ -22,8 +22,8 @@ import android.view.Menu;
import android.view.MenuItem;
public class Notepadv1 extends Activity {
- private int mNoteNumber = 1;
-
+ private int mNoteNumber = 1;
+
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
diff --git a/tutorials/NotepadCodeLab/Notepadv1/src/com/android/demo/notepad1/NotesDbAdapter.java b/tutorials/NotepadCodeLab/Notepadv1/src/com/android/demo/notepad1/NotesDbAdapter.java
index 6f85bbd20..a3295d613 100755
--- a/tutorials/NotepadCodeLab/Notepadv1/src/com/android/demo/notepad1/NotesDbAdapter.java
+++ b/tutorials/NotepadCodeLab/Notepadv1/src/com/android/demo/notepad1/NotesDbAdapter.java
@@ -43,13 +43,13 @@ public class NotesDbAdapter {
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 @@ public class NotesDbAdapter {
mDb = mDbHelper.getWritableDatabase();
return this;
}
-
+
public void close() {
mDbHelper.close();
}
@@ -158,9 +158,9 @@ public class NotesDbAdapter {
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();
}