Reconstructed Android native HTML skeletal app.

git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@3901 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/scout/proto1/.classpath b/scout/proto1/.classpath
new file mode 100644
index 0000000..a4f1e40
--- /dev/null
+++ b/scout/proto1/.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/scout/proto1/.project b/scout/proto1/.project
new file mode 100644
index 0000000..eb36f6a
--- /dev/null
+++ b/scout/proto1/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<projectDescription>

+	<name>Scout971</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/scout/proto1/AndroidManifest.xml b/scout/proto1/AndroidManifest.xml
new file mode 100644
index 0000000..6927d24
--- /dev/null
+++ b/scout/proto1/AndroidManifest.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"

+    package="org.frc971"

+    android:versionCode="1"

+    android:versionName="1.0" >

+

+    <uses-sdk

+        android:minSdkVersion="9"

+        android:targetSdkVersion="17" />
+    <permission android:name="android.permission.INTERNET"></permission>

+

+    <application

+        android:allowBackup="true"

+        android:icon="@drawable/ic_launcher"

+        android:label="@string/app_name"

+        android:theme="@style/AppTheme" >

+        <activity

+            android:name="org.frc971.MainActivity"

+            android:label="@string/app_name" >

+            <intent-filter>

+                <action android:name="android.intent.action.MAIN" />

+

+                <category android:name="android.intent.category.LAUNCHER" />

+            </intent-filter>

+        </activity>

+    </application>

+

+</manifest>
\ No newline at end of file
diff --git a/scout/proto1/assets/index.html b/scout/proto1/assets/index.html
new file mode 100644
index 0000000..a1e10e4
--- /dev/null
+++ b/scout/proto1/assets/index.html
@@ -0,0 +1,13 @@
+<html>

+<head>

+    <meta name="viewport" content="width=device-width,user-scalable=no" />

+    <title>971 Scout</title>

+</head>

+<body onload="window.frc.info('Howdy!');">

+    <h3>971 Scout</h3>

+    <input type="text" id="ib"><br />

+    <button onclick="window.frc.info(document.getElementById('ib').value);">Log Info</button>  

+    <button onclick="window.frc.error(document.getElementById('ib').value);">Log Error</button><br />

+    <button onclick="if (window.confirm('Exit now?')) window.frc.exitApp();">Exit This App</button><br />

+</body>

+</html>

diff --git a/scout/proto1/bin/AndroidManifest.xml b/scout/proto1/bin/AndroidManifest.xml
new file mode 100644
index 0000000..6927d24
--- /dev/null
+++ b/scout/proto1/bin/AndroidManifest.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"

+    package="org.frc971"

+    android:versionCode="1"

+    android:versionName="1.0" >

+

+    <uses-sdk

+        android:minSdkVersion="9"

+        android:targetSdkVersion="17" />
+    <permission android:name="android.permission.INTERNET"></permission>

+

+    <application

+        android:allowBackup="true"

+        android:icon="@drawable/ic_launcher"

+        android:label="@string/app_name"

+        android:theme="@style/AppTheme" >

+        <activity

+            android:name="org.frc971.MainActivity"

+            android:label="@string/app_name" >

+            <intent-filter>

+                <action android:name="android.intent.action.MAIN" />

+

+                <category android:name="android.intent.category.LAUNCHER" />

+            </intent-filter>

+        </activity>

+    </application>

+

+</manifest>
\ No newline at end of file
diff --git a/scout/proto1/bin/Scout971.apk b/scout/proto1/bin/Scout971.apk
new file mode 100644
index 0000000..4bed63c
--- /dev/null
+++ b/scout/proto1/bin/Scout971.apk
Binary files differ
diff --git a/scout/proto1/bin/classes.dex b/scout/proto1/bin/classes.dex
new file mode 100644
index 0000000..4a07b70
--- /dev/null
+++ b/scout/proto1/bin/classes.dex
Binary files differ
diff --git a/scout/proto1/bin/dexedLibs/android-support-v4-0ab0f29c4ec5a10b8eb6ef03e371bbc5.jar b/scout/proto1/bin/dexedLibs/android-support-v4-0ab0f29c4ec5a10b8eb6ef03e371bbc5.jar
new file mode 100644
index 0000000..e3bfe6c
--- /dev/null
+++ b/scout/proto1/bin/dexedLibs/android-support-v4-0ab0f29c4ec5a10b8eb6ef03e371bbc5.jar
Binary files differ
diff --git a/scout/proto1/bin/res/drawable-hdpi/ic_launcher.png b/scout/proto1/bin/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..e9b56e8
--- /dev/null
+++ b/scout/proto1/bin/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/scout/proto1/bin/res/drawable-ldpi/ic_launcher.png b/scout/proto1/bin/res/drawable-ldpi/ic_launcher.png
new file mode 100644
index 0000000..a961ab1
--- /dev/null
+++ b/scout/proto1/bin/res/drawable-ldpi/ic_launcher.png
Binary files differ
diff --git a/scout/proto1/bin/res/drawable-mdpi/ic_launcher.png b/scout/proto1/bin/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..4a3b95b
--- /dev/null
+++ b/scout/proto1/bin/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/scout/proto1/bin/res/drawable-xhdpi/ic_launcher.png b/scout/proto1/bin/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..e5509bc
--- /dev/null
+++ b/scout/proto1/bin/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/scout/proto1/bin/resources.ap_ b/scout/proto1/bin/resources.ap_
new file mode 100644
index 0000000..c430df9
--- /dev/null
+++ b/scout/proto1/bin/resources.ap_
Binary files differ
diff --git a/scout/proto1/ic_launcher-web.png b/scout/proto1/ic_launcher-web.png
new file mode 100644
index 0000000..5fa4a9e
--- /dev/null
+++ b/scout/proto1/ic_launcher-web.png
Binary files differ
diff --git a/scout/proto1/libs/android-support-v4.jar b/scout/proto1/libs/android-support-v4.jar
new file mode 100644
index 0000000..6080877
--- /dev/null
+++ b/scout/proto1/libs/android-support-v4.jar
Binary files differ
diff --git a/scout/proto1/lint.xml b/scout/proto1/lint.xml
new file mode 100644
index 0000000..ee0eead
--- /dev/null
+++ b/scout/proto1/lint.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lint>
+</lint>
\ No newline at end of file
diff --git a/scout/proto1/proguard-project.txt b/scout/proto1/proguard-project.txt
new file mode 100644
index 0000000..f2fe155
--- /dev/null
+++ b/scout/proto1/proguard-project.txt
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
diff --git a/scout/proto1/project.properties b/scout/proto1/project.properties
new file mode 100644
index 0000000..a3ee5ab
--- /dev/null
+++ b/scout/proto1/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=android-17
diff --git a/scout/proto1/res/drawable-hdpi/ic_launcher.png b/scout/proto1/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..b647be4
--- /dev/null
+++ b/scout/proto1/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/scout/proto1/res/drawable-ldpi/ic_launcher.png b/scout/proto1/res/drawable-ldpi/ic_launcher.png
new file mode 100644
index 0000000..e994323
--- /dev/null
+++ b/scout/proto1/res/drawable-ldpi/ic_launcher.png
Binary files differ
diff --git a/scout/proto1/res/drawable-mdpi/ic_launcher.png b/scout/proto1/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..428f289
--- /dev/null
+++ b/scout/proto1/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/scout/proto1/res/drawable-xhdpi/ic_launcher.png b/scout/proto1/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..a75b833
--- /dev/null
+++ b/scout/proto1/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/scout/proto1/res/layout/activity_main.xml b/scout/proto1/res/layout/activity_main.xml
new file mode 100644
index 0000000..80ec18a
--- /dev/null
+++ b/scout/proto1/res/layout/activity_main.xml
@@ -0,0 +1,14 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

+    xmlns:tools="http://schemas.android.com/tools"

+    android:layout_width="match_parent"

+    android:layout_height="match_parent"

+    tools:context=".MainActivity" >

+

+    <WebView

+        android:id="@+id/webView"

+        android:layout_width="match_parent"

+        android:layout_height="match_parent"

+        android:layout_alignParentLeft="true"

+        android:layout_alignParentTop="true" />

+

+</RelativeLayout>
\ No newline at end of file
diff --git a/scout/proto1/res/menu/activity_main.xml b/scout/proto1/res/menu/activity_main.xml
new file mode 100644
index 0000000..c46abce
--- /dev/null
+++ b/scout/proto1/res/menu/activity_main.xml
@@ -0,0 +1,9 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >

+

+    <item

+        android:id="@+id/menu_settings"

+        android:orderInCategory="100"

+        android:showAsAction="never"

+        android:title="@string/menu_settings"/>

+

+</menu>
\ No newline at end of file
diff --git a/scout/proto1/res/values-v11/styles.xml b/scout/proto1/res/values-v11/styles.xml
new file mode 100644
index 0000000..9643ba1
--- /dev/null
+++ b/scout/proto1/res/values-v11/styles.xml
@@ -0,0 +1,11 @@
+<resources>

+

+    <!--

+        Base application theme for API 11+. This theme completely replaces
+        AppBaseTheme from res/values/styles.xml on API 11+ devices.

+    -->

+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">

+        <!-- API 11 theme customizations can go here. -->

+    </style>

+

+</resources>
\ No newline at end of file
diff --git a/scout/proto1/res/values-v14/styles.xml b/scout/proto1/res/values-v14/styles.xml
new file mode 100644
index 0000000..50251a1
--- /dev/null
+++ b/scout/proto1/res/values-v14/styles.xml
@@ -0,0 +1,12 @@
+<resources>

+

+    <!--

+        Base application theme for API 14+. This theme completely replaces
+        AppBaseTheme from BOTH res/values/styles.xml and
+        res/values-v11/styles.xml on API 14+ devices.

+    -->

+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">

+        <!-- API 14 theme customizations can go here. -->

+    </style>

+

+</resources>
\ No newline at end of file
diff --git a/scout/proto1/res/values/strings.xml b/scout/proto1/res/values/strings.xml
new file mode 100644
index 0000000..12885a4
--- /dev/null
+++ b/scout/proto1/res/values/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>

+

+    <string name="app_name">971 Scout</string>

+    <string name="hello_world">Hello world!</string>

+    <string name="menu_settings">Settings</string>

+

+</resources>
\ No newline at end of file
diff --git a/scout/proto1/res/values/styles.xml b/scout/proto1/res/values/styles.xml
new file mode 100644
index 0000000..79a39af
--- /dev/null
+++ b/scout/proto1/res/values/styles.xml
@@ -0,0 +1,20 @@
+<resources>

+

+    <!--

+        Base application theme, dependent on API level. This theme is replaced
+        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.

+    -->

+    <style name="AppBaseTheme" parent="android:Theme.Light">

+        <!--

+            Theme customizations available in newer API levels can go in
+            res/values-vXX/styles.xml, while customizations related to
+            backward-compatibility can go here.

+        -->

+    </style>

+

+    <!-- Application theme. -->

+    <style name="AppTheme" parent="AppBaseTheme">

+        <!-- All customizations that are NOT specific to a particular API-level can go here. -->

+    </style>

+

+</resources>
\ No newline at end of file
diff --git a/scout/proto1/src/org/frc971/MainActivity.java b/scout/proto1/src/org/frc971/MainActivity.java
new file mode 100644
index 0000000..e5a7f2f
--- /dev/null
+++ b/scout/proto1/src/org/frc971/MainActivity.java
@@ -0,0 +1,76 @@
+package org.frc971;

+

+import android.annotation.SuppressLint;

+import android.app.Activity;

+import android.os.Bundle;

+import android.util.Log;

+import android.view.Menu;

+import android.view.Window;

+import android.webkit.JavascriptInterface;

+import android.webkit.WebChromeClient;

+import android.webkit.WebSettings;

+import android.webkit.WebView;

+import android.webkit.WebViewClient;

+

+public class MainActivity extends Activity {

+    private WebView browser = null;

+

+    final class JSHandler {

+	// write Info to LogCat

+	@JavascriptInterface

+	public void info(String str) {

+	    Log.i("FRC", str);

+	}

+

+	// write Error to LogCat

+	@JavascriptInterface

+	public void error(String str) {

+	    Log.e("FRC", str);

+	}

+

+	// Exit the app

+	@JavascriptInterface

+	public void exitApp() {

+	    finish();

+	}

+    }

+

+

+    @SuppressLint("SetJavaScriptEnabled") // Don't warn about XSS potential.

+    @Override

+    protected void onCreate(Bundle savedInstanceState) {

+	super.onCreate(savedInstanceState);

+

+	// The web page shows a heading so hide the app title.

+	requestWindowFeature(Window.FEATURE_NO_TITLE);

+

+	setContentView(R.layout.activity_main);

+

+	browser = (WebView)findViewById(R.id.webView);

+	browser.clearCache(true); // includeDiskFiles

+

+	// Configure the WebView.

+        WebSettings settings = browser.getSettings();

+        settings.setJavaScriptEnabled(true);

+

+        // Needed for "alert()" to work.

+        // TODO: Configure or subclass the WebChromeClient?

+        browser.setWebChromeClient(new WebChromeClient());

+

+        // TODO: more setup...

+        browser.setWebViewClient(new WebViewClient());

+

+        // Add a custom API to the JavaScript environment.

+        browser.addJavascriptInterface(new JSHandler(), "frc");

+

+        browser.loadUrl("file:///android_asset/index.html");

+    }

+

+    @Override

+    public boolean onCreateOptionsMenu(Menu menu) {

+	// Inflate the menu; this adds items to the action bar if it is present.

+	getMenuInflater().inflate(R.menu.activity_main, menu);

+	return true;

+    }

+

+}