Merge "Enable SDK/Eclipse building for TestingCamera" into jb-mr1-dev
diff --git a/apps/TestingCamera/.classpath b/apps/TestingCamera/.classpath
new file mode 100644
index 0000000..a4763d1
--- /dev/null
+++ b/apps/TestingCamera/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+	<classpathentry kind="output" path="bin/classes"/>
+</classpath>
diff --git a/apps/TestingCamera/.project b/apps/TestingCamera/.project
new file mode 100644
index 0000000..ff42d1d
--- /dev/null
+++ b/apps/TestingCamera/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>com.android.testingcamera.TestingCamera</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/apps/TestingCamera/Android.mk b/apps/TestingCamera/Android.mk
index bc02c86..d7e00d1 100644
--- a/apps/TestingCamera/Android.mk
+++ b/apps/TestingCamera/Android.mk
@@ -20,7 +20,7 @@
 
 LOCAL_MODULE_TAGS := optional
 
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_PACKAGE_NAME := TestingCamera
 
diff --git a/apps/TestingCamera/AndroidManifest.xml b/apps/TestingCamera/AndroidManifest.xml
index 6bc0f5b..a897e9d 100644
--- a/apps/TestingCamera/AndroidManifest.xml
+++ b/apps/TestingCamera/AndroidManifest.xml
@@ -22,11 +22,12 @@
   <uses-feature android:name="android.hardware.camera" />
   <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
 
-  <uses-sdk android:minSdkVersion="3" />
+  <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="16"/>
+  <uses-feature android:name="android.hardware.camera.front" android:required="false"/>
   <application
        android:icon="@mipmap/launcher_testingcamera"
        android:label="@string/app_name"
-       android:debuggable="true">
+       android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen">
     <activity
          android:name=".TestingCamera"
          android:label="@string/app_name"
diff --git a/apps/TestingCamera/project.properties b/apps/TestingCamera/project.properties
new file mode 100644
index 0000000..e484b3c
--- /dev/null
+++ b/apps/TestingCamera/project.properties
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=Google Inc.:Google APIs:16
diff --git a/apps/TestingCamera/res/layout/main.xml b/apps/TestingCamera/res/layout/main.xml
index e1ea6a0..5485f42 100644
--- a/apps/TestingCamera/res/layout/main.xml
+++ b/apps/TestingCamera/res/layout/main.xml
@@ -14,18 +14,18 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="horizontal" >
 
-<LinearLayout
-     xmlns:android="http://schemas.android.com/apk/res/android"
-     android:orientation="horizontal"
-     android:layout_width="fill_parent"
-     android:layout_height="fill_parent">
     <LinearLayout
-         android:orientation="vertical"
-         android:layout_height="fill_parent"
-         android:layout_width="0px"
-         android:layout_weight="6"
-         >
+        android:id="@+id/preview_column"
+        android:layout_width="0px"
+        android:layout_height="fill_parent"
+        android:layout_weight="6"
+        android:orientation="vertical" >
+
         <SurfaceView
              android:id="@+id/preview"
              android:layout_width="fill_parent"
@@ -39,36 +39,49 @@
              android:layout_weight="1"
              />
     </LinearLayout>
-    <LinearLayout
-         android:orientation="vertical"
-         android:layout_height="wrap_content"
-         android:layout_width="0px"
-         android:layout_weight="2"
-         >
 
-        <Spinner
-             android:id="@+id/camera_spinner"
-             android:layout_width="fill_parent"
-             android:layout_height="wrap_content"
-             />
-        <Spinner
-             android:id="@+id/preview_size_spinner"
-             android:layout_width="fill_parent"
-             android:layout_height="wrap_content"
-             />
-        <ToggleButton
-             android:id="@+id/start_preview"
-             android:layout_width="fill_parent"
-             android:layout_height="wrap_content"
-             android:textOn="@string/preview_on_label"
-             android:textOff="@string/preview_off_label"
-             />
-        <Button
-             android:id="@+id/take_picture"
-             android:layout_width="fill_parent"
-             android:layout_height="wrap_content"
-             android:text="@string/take_picture_label"
-             />
-    </LinearLayout>
+    <ScrollView
+        android:id="@+id/control_bar"
+        android:layout_width="0px"
+        android:layout_height="match_parent"
+        android:layout_weight="2" >
+
+        <LinearLayout
+            android:id="@+id/control_bar_contents"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical" >
+
+            <Spinner
+                android:id="@+id/camera_spinner"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:prompt="@string/camera_selection_prompt" />
+
+            <Spinner
+                android:id="@+id/preview_size_spinner"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:prompt="@string/preview_resolution_prompt" />
+
+            <ToggleButton
+                android:id="@+id/start_preview"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:textOff="@string/preview_off_label"
+                android:textOn="@string/preview_on_label" />
+
+            <Button
+                android:id="@+id/take_picture"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="@string/take_picture_label" />
+
+        </LinearLayout>
+    </ScrollView>
 
 </LinearLayout>
diff --git a/apps/TestingCamera/res/values/strings.xml b/apps/TestingCamera/res/values/strings.xml
index e86027e..45ddaa2 100644
--- a/apps/TestingCamera/res/values/strings.xml
+++ b/apps/TestingCamera/res/values/strings.xml
@@ -21,4 +21,7 @@
     <string name="preview_on_label">Preview On</string>
     <string name="preview_off_label">Preview Off</string>
     <string name="take_picture_label">Take picture</string>
+    <string name="preview_resolution_prompt">Select preview resolution</string>
+    <string name="camera_selection_prompt">Select camera</string>
+    <string name="default_camera_entry">No cameras found</string>
 </resources>
diff --git a/apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java b/apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java
index 611093b..645dc61 100644
--- a/apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java
+++ b/apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java
@@ -44,6 +44,9 @@
 
 /**
  * A simple test application for the camera API.
+ *
+ * The goal of this application is to allow all camera API features to be
+ * excercised, and all information provided by the API to be shown.
  */
 public class TestingCamera extends Activity implements SurfaceHolder.Callback {