Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge the two PA example repos

Conflicts:
	.gitignore
	02/FillListTask/tools/ide/eclipse/classpath
	02/SharedListTask/tools/ide/eclipse/classpath
	03/TestApp/tools/ide/eclipse/classpath
	06/AIDLDemo/tools/ide/eclipse/classpath
	06/AsyncTaskDemo/tools/ide/eclipse/classpath
	07/AndroidUIDemo/tools/ide/eclipse/classpath
	08/SimpleFragment/default.properties
	10/MicroJobs/tools/ant/build.xml
	11/FinchLifecycle/default.properties
	11/FinchLifecycle/proguard.cfg
	11/FinchLifecycleBackport/proguard.cfg
	12/FinchVideo/tools/ant/build.xml
	16/SensorDemos/default.properties
	16/SensorDemos/proguard.cfg
	17/ClientDemo/default.properties
	18/NDKDemo/default.properties
	AIDLDemo/project.properties
	AIDLDemo/tools/ide/eclipse/classpath
	AndroidUIDemo/project.properties
	AndroidUIDemo/res/layout/main.xml
	AndroidUIDemo/res/values/colors.xml
	AndroidUIDemo/src/com/oreilly/demo/android/pa/uidemo/view/DotView.java
	AndroidUIDemo/tools/ide/eclipse/classpath
	AndroidViewDemo/project.properties
	AsyncTaskDemo/proguard.cfg
	AsyncTaskDemo/tools/ant/build.xml
	AudioPlayer/proguard.cfg
	FillListTask/tools/ide/eclipse/classpath
	FinchChat/tools/ide/eclipse/classpath
	FinchFramework/project.properties
	FinchFramework/src/com/finchframework/finch/views/MesgEditText.java
	FinchLifecycle/project.properties
	FinchLifecycle/tools/ant/build.xml
	FinchLifecycle/tools/ide/eclipse/classpath
	FinchLifecycleBackport/proguard.cfg
	FinchLifecycleBackport/project.properties
	FinchVideo/project.properties
	FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/FinchVideoActivity.java
	NDKDemo/proguard.cfg
	NDKDemo/tools/ant/build.xml
	README.txt
	SearchDemo/project.properties
	SensorDemos/proguard.cfg
	SharedListTask/tools/ide/eclipse/classpath
	UIFramework/proguard.cfg
	UIFramework/project.properties
  • Loading branch information...
commit f93c51f3efd1207dfc91a17be588ae28f6de2998 2 parents 4800c4a + 8cdbaf9
@bmeike authored
Showing with 98 additions and 159 deletions.
  1. +1 −1  .gitignore
  2. +1 −1  AIDLDemo/project.properties
  3. +1 −1  AndroidUIDemo/project.properties
  4. +1 −1  AndroidViewDemo/project.properties
  5. +1 −1  AsyncTaskDemo/project.properties
  6. +1 −1  ClientDemo/project.properties
  7. +1 −1  ContactViewer/project.properties
  8. +21 −14 FinchChat/AndroidManifest.xml
  9. +1 −1  FinchChat/project.properties
  10. +1 −1  FinchFramework/project.properties
  11. +0 −87 FinchFramework/src/com/finchframework/finch/views/MesgEditText.java
  12. +1 −1  FinchLifecycle/project.properties
  13. +1 −1  FinchLifecycleBackport/project.properties
  14. +29 −19 FinchVideo/AndroidManifest.xml
  15. +1 −1  FinchVideo/project.properties
  16. +1 −2  FinchVideo/res/layout/video_query_activity.xml
  17. +1 −1  FinchVideo/res/values/strings.xml
  18. +20 −6 FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/FinchVideoActivity.java
  19. +2 −2 FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/provider/FinchVideo.java
  20. +1 −1  FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/provider/FinchVideoContentProvider.java
  21. +4 −8 FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/provider/SimpleFinchVideoContentProvider.java
  22. +2 −2 FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/provider/YouTubeHandler.java
  23. +1 −1  JSerializable/project.properties
  24. +1 −1  LifecycleDemos/project.properties
  25. +1 −1  MicroJobs/project.properties
  26. +1 −1  SensorDemos/project.properties
  27. +1 −1  SimpleFragment/project.properties
View
2  .gitignore
@@ -3,8 +3,8 @@
.classpath
.project
.settings
+.metadata
bin
gen
lint.xml
-/.metadata
View
2  AIDLDemo/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
View
2  AndroidUIDemo/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
View
2  AndroidViewDemo/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
View
2  AsyncTaskDemo/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
View
2  ClientDemo/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
View
2  ContactViewer/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-7
+target=android-15
View
35 FinchChat/AndroidManifest.xml
@@ -1,28 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.finchframework.finch"
- android:versionCode="1"
- android:versionName="1.0">
- <application android:icon="@drawable/icon"
- android:label="@string/app_name"
- android:debuggable="true">
- <activity android:name=".FinchWelcome"
- android:label="@string/app_name">
+ package="com.finchframework.finch"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <application
+ android:debuggable="true"
+ android:icon="@drawable/icon"
+ android:label="@string/app_name" >
+ <activity
+ android:name=".FinchWelcome"
+ android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
+
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.finchframework.bluetooth.BtConsoleActivity" />
- <activity android:name="com.finchframework.bluetooth.DeviceListActivity"
- android:label="@string/select_device"
- android:configChanges="orientation|keyboardHidden"/>
- <activity android:name="animate.AnimateActivity"></activity>
+ <activity
+ android:name="com.finchframework.bluetooth.DeviceListActivity"
+ android:configChanges="orientation|keyboardHidden"
+ android:label="@string/select_device" />
+ <activity android:name="animate.AnimateActivity" >
+ </activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH" />
- <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
+ <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-sdk android:minSdkVersion="7" />
-</manifest>
+
+</manifest>
View
2  FinchChat/project.properties
@@ -8,5 +8,5 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
android.library=false
View
2  FinchFramework/project.properties
@@ -8,5 +8,5 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
android.library=true
View
87 FinchFramework/src/com/finchframework/finch/views/MesgEditText.java
@@ -1,87 +0,0 @@
-package com.finchframework.finch.views;
-
-import android.content.Context;
-import android.graphics.Rect;
-import android.text.Editable;
-import android.util.AttributeSet;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-import android.widget.EditText;
-
-/**
- * A text field that can display a default message until a user types in their
- * own text.
- */
-public class MesgEditText extends EditText {
- private String mMesgText;
-
- public MesgEditText(Context context) {
- super(context);
- }
-
- public MesgEditText(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-
- public MesgEditText(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public void setMesgText(String messageText) {
- mMesgText = messageText;
- setText(messageText);
- }
-
- @Override
- public Editable getText() {
- CharSequence current = super.getText();
- if ((current != null) && mMesgText.equals(current)) {
- current = "";
- }
- return Editable.Factory.getInstance().newEditable(current);
- }
-
- @Override
- protected void onFocusChanged(boolean focused, int direction,
- Rect previouslyFocusedRect)
- {
- super.onFocusChanged(focused, direction, previouslyFocusedRect);
- userOverride();
- }
-
- @Override
- public boolean onKeyDown(int keyCode, KeyEvent keyEvent) {
-// if (keyCode == KeyEvent.KEYCODE_ENTER) {
- userOverride();
-// }
- return super.onKeyDown(keyCode, keyEvent);
- }
-
- @Override
- public boolean onTouchEvent(MotionEvent event) {
- boolean superResponse = super.onTouchEvent(event);
- String actualText = super.getText().toString();
- if (mMesgText.equals(actualText)) {
- super.setText("");
- }
- return superResponse;
- }
-
- private void userOverride() {
- String actualText = super.getText().toString();
- if (!hasFocus() && actualText.equals("")) {
- setText(mMesgText);
- }
- if (hasFocus() && actualText.equals(mMesgText)) {
- setText("");
- }
- }
-
- public boolean searchEmpty() {
- CharSequence actualText = super.getText();
-
- return ((actualText == null) ||
- mMesgText.equals(actualText.toString()) ||
- "".equals(actualText.toString()));
- }
-}
View
2  FinchLifecycle/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
View
2  FinchLifecycleBackport/project.properties
@@ -8,5 +8,5 @@
# project structure.
# Project target.
-target=android-7
+target=android-15
android.library.reference.1=../FinchFramework
View
48 FinchVideo/AndroidManifest.xml
@@ -1,32 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.oreilly.demo.android.pa.finchvideo"
- android:versionCode="1"
- android:versionName="1.0">
- <application android:icon="@drawable/icon"
- android:label="@string/app_name"
- android:debuggable="true">
- <provider android:name=".provider.FinchVideoContentProvider"
- android:authorities="com.oreilly.demo.android.pa.finchvideo.FinchVideo"
- />
- <provider android:name=".provider.SimpleFinchVideoContentProvider"
- android:authorities="com.oreilly.demo.android.pa.finchvideo.SimpleFinchVideo"
- />
- <activity android:name=".FinchVideoActivity"
- android:label="@string/finch_video_app_name" >
+ package="com.oreilly.demo.android.pa.finchvideo"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-permission android:name="android.permission.INTERNET" />
+
+ <uses-sdk android:minSdkVersion="7" />
+
+ <application
+ android:debuggable="true"
+ android:icon="@drawable/icon"
+ android:label="@string/app_name" >
+ <provider
+ android:name=".provider.FinchVideoContentProvider"
+ android:authorities="com.oreilly.demo.android.pa.finchvideo.FinchVideo" />
+ <provider
+ android:name=".provider.SimpleFinchVideoContentProvider"
+ android:authorities="com.oreilly.demo.android.pa.finchvideo.SimpleFinchVideo" />
+
+ <activity
+ android:name=".FinchVideoActivity"
+ android:label="@string/finch_video_app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
+
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
- <activity android:name=".SimpleFinchVideoActivity"
- android:label="Simple Video Activity">
+ <activity
+ android:name=".SimpleFinchVideoActivity"
+ android:label="Simple Video Activity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
+
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-sdk android:minSdkVersion="7" />
-</manifest>
+
+</manifest>
View
2  FinchVideo/project.properties
@@ -8,5 +8,5 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
android.library.reference.1=../FinchFramework
View
3  FinchVideo/res/layout/video_query_activity.xml
@@ -20,14 +20,13 @@
android:layout_gravity="center_horizontal"
android:background="@color/medium_gray"
>
- <com.finchframework.finch.views.MesgEditText
+ <EditText
android:id="@+id/video_search_box"
android:width="0px"
android:height="40px"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/finch_video_search"
android:lines="1"
android:singleLine="true"
/>
View
2  FinchVideo/res/values/strings.xml
@@ -3,7 +3,7 @@
<string name="finch_video_app_name">Finch Video</string>
<string name="finch_video_update_content">Update Content</string>
<string name="finch_video_search">Search Videos</string>
- <string name="app_name">YouTube Video Example</string>
+ <string name="app_name">FinchVideo</string>
<string name="simple_insert_text">Insert</string>
<string name="title">Title</string>
View
26 FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/FinchVideoActivity.java
@@ -8,6 +8,7 @@
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
+import android.text.Editable;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
@@ -17,8 +18,9 @@
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
+
import com.finchframework.finch.Finch;
-import com.finchframework.finch.views.MesgEditText;
+
import com.oreilly.demo.android.pa.finchvideo.provider.FinchVideo;
import java.io.FileNotFoundException;
@@ -33,7 +35,7 @@
public class FinchVideoActivity extends Activity {
SimpleCursorAdapter mAdapter;
- private MesgEditText mSearchText;
+ private EditText mSearchText;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -83,8 +85,7 @@ public boolean setViewValue(View view, Cursor cursor, int i) {
searchList.setAdapter(mAdapter);
- mSearchText = (MesgEditText) findViewById(R.id.video_search_box);
- mSearchText.setMesgText(r.getString(R.string.finch_video_search));
+ mSearchText = (EditText) findViewById(R.id.video_search_box);
mSearchText.setOnEditorActionListener(
new EditText.OnEditorActionListener() {
@Override
@@ -137,10 +138,11 @@ void setThumbResource(View view, Cursor cursor) {
// sends the query to the finch video content provider
void query() {
- if (!mSearchText.searchEmpty()) {
+ String searchText = getText();
+ if (!searchEmpty(searchText)) {
String queryString =
FinchVideo.Videos.QUERY_PARAM_NAME + "=" +
- Uri.encode(mSearchText.getText().toString());
+ Uri.encode(searchText.toString());
Uri queryUri =
Uri.parse(FinchVideo.Videos.CONTENT_URI + "?" +
queryString);
@@ -148,4 +150,16 @@ void query() {
mAdapter.changeCursor(c);
}
}
+
+ private String getText() {
+ Editable editable = mSearchText.getText();
+ if (editable != null) {
+ return editable.toString();
+ }
+ return null;
+ }
+
+ private boolean searchEmpty(String text) {
+ return (text != null) && ("".equals(text));
+ }
}
View
4 FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/provider/FinchVideo.java
@@ -23,10 +23,10 @@
public static final int MEDIA_ID_COLUMN = 8;
public static final String AUTHORITY =
- "com.oreilly.demo.pa.finchvideo.FinchVideo";
+ "com.oreilly.demo.android.pa.finchvideo.FinchVideo";
public static final String SIMPLE_AUTHORITY =
- "com.oreilly.demo.pa.finchvideo.SimpleFinchVideo";
+ "com.oreilly.demo.android.pa.finchvideo.SimpleFinchVideo";
/**
* Simple Videos columns
*/
View
2  ...hVideo/src/com/oreilly/demo/android/pa/finchvideo/provider/FinchVideoContentProvider.java
@@ -32,7 +32,7 @@
public static final String VIDEOS_TABLE_NAME = "video";
private static final String FILE_CACHE_DIR =
- "/data/data/com.oreilly.demo.pa.finchvideo/file_cache";
+ "/data/data/com.oreilly.demo.android.pa.finchvideo/file_cache";
private static final int VIDEOS = 1;
private static final int VIDEO_ID = 2;
View
12 .../src/com/oreilly/demo/android/pa/finchvideo/provider/SimpleFinchVideoContentProvider.java
@@ -21,9 +21,6 @@
* provider that stores basic video meta-data.
*/
public class SimpleFinchVideoContentProvider extends ContentProvider {
- public static final String AUTHORITY =
- "com.oreilly.demo.pa.finchvideo.SimpleFinchVideo";
-
public static final String SIMPLE_VIDEO = "simple_video";
private static final int VIDEOS = 1;
@@ -35,10 +32,10 @@
static {
sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
- sUriMatcher.addURI(AUTHORITY, FinchVideo.SimpleVideos.VIDEO_NAME,
+ sUriMatcher.addURI(FinchVideo.SIMPLE_AUTHORITY, FinchVideo.SimpleVideos.VIDEO_NAME,
VIDEOS);
// use of the hash character indicates matching of an id
- sUriMatcher.addURI(AUTHORITY,
+ sUriMatcher.addURI(FinchVideo.SIMPLE_AUTHORITY,
FinchVideo.SimpleVideos.VIDEO_NAME + "/#", VIDEO_ID);
// example projection map, not actually used in this application
@@ -196,9 +193,8 @@ public Uri insert(Uri uri, ContentValues initialValues) {
long rowId = db.insert(VIDEO_TABLE_NAME,
FinchVideo.SimpleVideos.VIDEO_NAME, values);
if (rowId > 0) {
- Uri videoURi =
- ContentUris.withAppendedId(
- FinchVideo.SimpleVideos.CONTENT_URI, rowId);
+ Uri videoURi = ContentUris.withAppendedId(
+ FinchVideo.SimpleVideos.CONTENT_URI, rowId);
getContext().getContentResolver().notifyChange(videoURi, null);
return videoURi;
}
View
4 FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/provider/YouTubeHandler.java
@@ -22,7 +22,7 @@
import java.io.InputStreamReader;
/**
- * Parses YouTube Entity data and and inserts it into the finch video content
+ * Parses YouTube entity data and and inserts it into the finch video content
* provider.
*/
public class YouTubeHandler implements ResponseHandler {
@@ -99,7 +99,7 @@ private void deleteOld() {
null, null, null, null);
int c = old.getCount();
if (old.getCount() > 0) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
boolean next;
if (old.moveToNext()) {
do {
View
2  JSerializable/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
View
2  LifecycleDemos/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
View
2  MicroJobs/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=Google Inc.:Google APIs:8
+target=Google Inc.:Google APIs:15
View
2  SensorDemos/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
View
2  SimpleFragment/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-14
+target=android-15
Please sign in to comment.
Something went wrong with that request. Please try again.