Skip to content

Commit db6d53a

Browse files
committed
Added Notepad Tutorial to repo
1 parent 9f0d86b commit db6d53a

File tree

74 files changed

+2796
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2796
-0
lines changed

HelloAndroid/bin/HelloAndroid.apk

13 KB
Binary file not shown.

HelloAndroid/bin/classes.dex

2.19 KB
Binary file not shown.

HelloAndroid/bin/resources.ap_

10.2 KB
Binary file not shown.

HelloListView/.classpath

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="src" path="gen"/>
5+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>

HelloListView/.project

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>HelloListView</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.jdt.core.javabuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
</natures>
33+
</projectDescription>

HelloListView/AndroidManifest.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="sm.listView"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
<uses-sdk android:minSdkVersion="8" />
7+
8+
<application android:icon="@drawable/icon" android:label="@string/app_name">
9+
<activity android:name=".HelloListViewActivity"
10+
android:label="@string/app_name">
11+
<intent-filter>
12+
<action android:name="android.intent.action.MAIN" />
13+
<category android:name="android.intent.category.LAUNCHER" />
14+
</intent-filter>
15+
</activity>
16+
17+
</application>
18+
</manifest>

HelloListView/bin/HelloListView.apk

14.6 KB
Binary file not shown.

HelloListView/bin/classes.dex

3.71 KB
Binary file not shown.

HelloListView/bin/resources.ap_

10.9 KB
Binary file not shown.

HelloListView/default.properties

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system use,
7+
# "build.properties", and override values to adapt the script to your
8+
# project structure.
9+
10+
# Project target.
11+
target=android-8

HelloListView/gen/sm/listView/R.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* AUTO-GENERATED FILE. DO NOT MODIFY.
2+
*
3+
* This class was automatically generated by the
4+
* aapt tool from the resource data it found. It
5+
* should not be modified by hand.
6+
*/
7+
8+
package sm.listView;
9+
10+
public final class R {
11+
public static final class array {
12+
public static final int countries_array=0x7f050000;
13+
}
14+
public static final class attr {
15+
}
16+
public static final class drawable {
17+
public static final int icon=0x7f020000;
18+
}
19+
public static final class layout {
20+
public static final int list_item=0x7f030000;
21+
public static final int main=0x7f030001;
22+
}
23+
public static final class string {
24+
public static final int app_name=0x7f040001;
25+
public static final int hello=0x7f040000;
26+
}
27+
}

HelloListView/proguard.cfg

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-optimizationpasses 5
2+
-dontusemixedcaseclassnames
3+
-dontskipnonpubliclibraryclasses
4+
-dontpreverify
5+
-verbose
6+
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7+
8+
-keep public class * extends android.app.Activity
9+
-keep public class * extends android.app.Application
10+
-keep public class * extends android.app.Service
11+
-keep public class * extends android.content.BroadcastReceiver
12+
-keep public class * extends android.content.ContentProvider
13+
-keep public class * extends android.app.backup.BackupAgentHelper
14+
-keep public class * extends android.preference.Preference
15+
-keep public class com.android.vending.licensing.ILicensingService
16+
17+
-keepclasseswithmembernames class * {
18+
native <methods>;
19+
}
20+
21+
-keepclasseswithmembers class * {
22+
public <init>(android.content.Context, android.util.AttributeSet);
23+
}
24+
25+
-keepclasseswithmembers class * {
26+
public <init>(android.content.Context, android.util.AttributeSet, int);
27+
}
28+
29+
-keepclassmembers class * extends android.app.Activity {
30+
public void *(android.view.View);
31+
}
32+
33+
-keepclassmembers enum * {
34+
public static **[] values();
35+
public static ** valueOf(java.lang.String);
36+
}
37+
38+
-keep class * implements android.os.Parcelable {
39+
public static final android.os.Parcelable$Creator *;
40+
}
4.05 KB
Loading
1.68 KB
Loading
2.51 KB
Loading
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="fill_parent"
5+
android:padding="10dp"
6+
android:textSize="16sp" >
7+
</TextView>

HelloListView/res/layout/main.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical"
4+
android:layout_width="fill_parent"
5+
android:layout_height="fill_parent"
6+
>
7+
<TextView
8+
android:layout_width="fill_parent"
9+
android:layout_height="wrap_content"
10+
android:text="@string/hello"
11+
/>
12+
</LinearLayout>

HelloListView/res/values/strings.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="hello">Hello World, HelloListViewActivity!</string>
4+
<string name="app_name">HelloListView</string>
5+
<string-array name="countries_array">
6+
<item>Bahrain</item>
7+
<item>Bangladesh</item>
8+
<item>Barbados</item>
9+
<item>Belarus</item>
10+
<item>Belgium</item>
11+
<item>Belize</item>
12+
<item>Benin</item>
13+
</string-array>
14+
</resources>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package sm.listView;
2+
3+
import android.app.Activity;
4+
import android.app.ListActivity;
5+
import android.os.Bundle;
6+
import android.view.View;
7+
import android.widget.*;
8+
import android.widget.AdapterView.OnItemClickListener;
9+
10+
public class HelloListViewActivity extends ListActivity {
11+
/** Called when the activity is first created. */
12+
@Override
13+
public void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(savedInstanceState);
15+
16+
String[] countries = getResources().getStringArray(R.array.countries_array);
17+
18+
setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, countries));
19+
20+
ListView lv = getListView();
21+
lv.setTextFilterEnabled(true);
22+
23+
lv.setOnItemClickListener(new OnItemClickListener() {
24+
public void onItemClick(AdapterView<?> parent, View view,
25+
int position, long id) {
26+
// When clicked, show a toast with the TextView text
27+
Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
28+
Toast.LENGTH_SHORT).show();
29+
}
30+
});
31+
}
32+
}

Notepadv1/Android.mk

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# Copyright (C) 2009 The Android Open Source Project
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
LOCAL_PATH:= $(call my-dir)
18+
include $(CLEAR_VARS)
19+
20+
# Only build apk if this package is added to CUSTOM_MODLUES in buildspec.mk
21+
LOCAL_MODULE_TAGS := optional
22+
23+
# Only compile source java files in this apk.
24+
LOCAL_SRC_FILES := $(call all-java-files-under, src)
25+
26+
LOCAL_PACKAGE_NAME := Notepadv1
27+
28+
# Make the app build against the current SDK
29+
LOCAL_SDK_VERSION := current
30+
31+
include $(BUILD_PACKAGE)

Notepadv1/AndroidManifest.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.android.demo.notepad1">
4+
<application android:icon="@drawable/icon">
5+
<activity android:name=".Notepadv1" android:label="@string/app_name">
6+
<intent-filter>
7+
<action android:name="android.intent.action.MAIN" />
8+
<category android:name="android.intent.category.LAUNCHER" />
9+
</intent-filter>
10+
</activity>
11+
</application>
12+
</manifest>

Notepadv1/res/drawable/icon.png

5.95 KB
Loading

Notepadv1/res/layout/notepad_list.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="wrap_content"
4+
android:layout_height="wrap_content">
5+
6+
</LinearLayout>

Notepadv1/res/values/strings.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="app_name">Notepad v1</string>
4+
<string name="no_notes">No Notes Yet</string>
5+
</resources>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (C) 2008 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.android.demo.notepad1;
18+
19+
import android.app.Activity;
20+
import android.os.Bundle;
21+
import android.view.Menu;
22+
import android.view.MenuItem;
23+
24+
public class Notepadv1 extends Activity {
25+
private int mNoteNumber = 1;
26+
27+
/** Called when the activity is first created. */
28+
@Override
29+
public void onCreate(Bundle savedInstanceState) {
30+
super.onCreate(savedInstanceState);
31+
}
32+
33+
@Override
34+
public boolean onCreateOptionsMenu(Menu menu) {
35+
// TODO Auto-generated method stub
36+
return super.onCreateOptionsMenu(menu);
37+
}
38+
39+
@Override
40+
public boolean onOptionsItemSelected(MenuItem item) {
41+
// TODO Auto-generated method stub
42+
return super.onOptionsItemSelected(item);
43+
}
44+
}

0 commit comments

Comments
 (0)