changeset 501:e505597c17fb Android_Skia

testpath is an Android Java application for demo MadButterfly.
author Thinker K.F. Li <thinker@branda.to>
date Tue, 01 Dec 2009 22:55:08 +0800
parents f06eba21db1c
children a53fc3eff8f1
files Android/examples/testpath/AndroidManifest.xml Android/examples/testpath/build.properties Android/examples/testpath/build.xml Android/examples/testpath/default.properties Android/examples/testpath/local.properties Android/examples/testpath/res/layout/main.xml Android/examples/testpath/res/values/strings.xml Android/examples/testpath/src/org/madbutterfly/android/examples/testpath/testpath.java Android/examples/testpath/tests/AndroidManifest.xml Android/examples/testpath/tests/build.properties Android/examples/testpath/tests/build.xml Android/examples/testpath/tests/default.properties Android/examples/testpath/tests/local.properties Android/examples/testpath/tests/src/org/madbutterfly/android/examples/testpath/testpathTest.java
diffstat 14 files changed, 318 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/AndroidManifest.xml	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="org.madbutterfly.android.examples.testpath"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <application android:label="@string/app_name">
+        <activity android:name=".testpath"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+	<uses-library android:name="libmbfly-jni" />
+    </application>
+</manifest> 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/build.properties	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,20 @@
+# This file is used to override default values used by the Ant build system.
+# 
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+#  'source-folder' for the location of your java source folder and
+#  'out-folder' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+#  'key.store' for the location of your keystore and
+#  'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
+# The name of your application package as defined in the manifest.
+# Used by the 'uninstall' rule.
+application-package=org.madbutterfly.android.examples.testpath
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/build.xml	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="testpath" default="help">
+
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contain the path to the SDK. It should *NOT* be checked in in Version
+         Control Systems. -->
+    <property file="local.properties"/>
+
+    <!-- The build.properties file can be created by you and is never touched
+         by the 'android' tool. This is the place to change some of the default property values
+         used by the Ant rules.
+         Here are some properties you may want to change/update:
+
+         application-package
+             the name of your application package as defined in the manifest. Used by the
+             'uninstall' rule.
+         source-folder
+             the name of the source folder. Default is 'src'.
+         out-folder
+             the name of the output folder. Default is 'bin'.
+
+         Properties related to the SDK location or the project target should be updated
+          using the 'android' tool with the 'update' action.
+
+         This file is an integral part of the build system for your application and
+         should be checked in in Version Control Systems.
+
+         -->
+    <property file="build.properties"/>
+
+    <!-- The default.properties file is created and updated by the 'android' tool, as well
+         as ADT. 
+         This file is an integral part of the build system for your application and
+         should be checked in in Version Control Systems. -->
+    <property file="default.properties"/>
+
+    <!-- Custom Android task to deal with the project target, and import the proper rules.
+         This requires ant 1.6.0 or above. -->
+    <path id="android.antlibs">
+        <pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
+        <pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
+        <pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
+        <pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
+        <pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
+        <pathelement path="${sdk-location}/tools/lib/mbfly-java.jar" />
+    </path>
+
+    <taskdef name="setup"
+        classname="com.android.ant.SetupTask"
+        classpathref="android.antlibs"/>
+
+    <!-- Execute the Android Setup task that will setup some properties specific to the target,
+         and import the build rules files.
+
+         The rules file is imported from
+            <SDK>/platforms/<target_platform>/templates/android_rules.xml
+
+         To customize some build steps for your project:
+         - copy the content of the main node <project> from android_rules.xml
+         - paste it in this build.xml below the <setup /> task.
+         - disable the import by changing the setup task below to <setup import="false" />
+         
+         This will ensure that the properties are setup correctly but that your customized
+         build steps are used.
+    -->
+    <setup />
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/default.properties	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,11 @@
+# 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 use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/local.properties	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,10 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must *NOT* be checked in Version Control Systems,
+# as it contains information specific to your local configuration.
+
+# location of the SDK. This is only used by Ant
+# For customization when using a Version Control System, please read the
+# header note.
+sdk-location=/home/thinker/progm/Android/out/host/freebsd-x86/sdk/android-sdk_eng.thinker_freebsd-x86
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/res/layout/main.xml	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    >
+<TextView  
+    android:layout_width="fill_parent" 
+    android:layout_height="wrap_content" 
+    android:text="Hello World, testpath"
+    />
+</LinearLayout>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/res/values/strings.xml	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">testpath</string>
+</resources>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/src/org/madbutterfly/android/examples/testpath/testpath.java	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,28 @@
+package org.madbutterfly.android.examples.testpath;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Bundle;
+import org.madbutterfly.MBView;
+import org.madbutterfly.redraw_man;
+
+public class testpath extends Activity
+{
+    class myview extends MBView {
+	public myview(Context ctx) {
+	    super(ctx);
+	}
+    }
+
+    MBView main_view;
+
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+        // setContentView(R.layout.main);
+	main_view = new myview(this);
+	setContentView(main_view);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/tests/AndroidManifest.xml	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="org.madbutterfly.android.examples.testpath.tests"
+          android:versionCode="1"
+          android:versionName="1.0">
+    <!-- We add an application tag here just so that we can indicate that
+         this package needs to link against the android.test library,
+         which is needed when building test cases. -->
+    <application>
+        <uses-library android:name="android.test.runner" />
+    </application>
+    <!--
+    This declares that this application uses the instrumentation test runner targeting
+    the package of org.madbutterfly.android.examples.testpath.  To run the tests use the command:
+    "adb shell am instrument -w org.madbutterfly.android.examples.testpath.tests/android.test.InstrumentationTestRunner"
+    -->
+    <instrumentation android:name="android.test.InstrumentationTestRunner"
+                     android:targetPackage="org.madbutterfly.android.examples.testpath"
+                     android:label="Tests for testpath"/>
+</manifest>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/tests/build.properties	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,20 @@
+# This file is used to override default values used by the Ant build system.
+# 
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+#  'source-folder' for the location of your java source folder and
+#  'out-folder' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+#  'key.store' for the location of your keystore and
+#  'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
+# The name of your application package as defined in the manifest.
+# Used by the 'uninstall' rule.
+application-package=org.madbutterfly.android.examples.testpath
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/tests/build.xml	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="testpath" default="help">
+
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contain the path to the SDK. It should *NOT* be checked in in Version
+         Control Systems. -->
+    <property file="local.properties"/>
+
+    <!-- The build.properties file can be created by you and is never touched
+         by the 'android' tool. This is the place to change some of the default property values
+         used by the Ant rules.
+         Here are some properties you may want to change/update:
+
+         application-package
+             the name of your application package as defined in the manifest. Used by the
+             'uninstall' rule.
+         source-folder
+             the name of the source folder. Default is 'src'.
+         out-folder
+             the name of the output folder. Default is 'bin'.
+
+         Properties related to the SDK location or the project target should be updated
+          using the 'android' tool with the 'update' action.
+
+         This file is an integral part of the build system for your application and
+         should be checked in in Version Control Systems.
+
+         -->
+    <property file="build.properties"/>
+
+    <!-- The default.properties file is created and updated by the 'android' tool, as well
+         as ADT. 
+         This file is an integral part of the build system for your application and
+         should be checked in in Version Control Systems. -->
+    <property file="default.properties"/>
+
+    <!-- Custom Android task to deal with the project target, and import the proper rules.
+         This requires ant 1.6.0 or above. -->
+    <path id="android.antlibs">
+        <pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
+        <pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
+        <pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
+        <pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
+        <pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
+    </path>
+
+    <taskdef name="setup"
+        classname="com.android.ant.SetupTask"
+        classpathref="android.antlibs"/>
+
+    <!-- Execute the Android Setup task that will setup some properties specific to the target,
+         and import the build rules files.
+
+         The rules file is imported from
+            <SDK>/platforms/<target_platform>/templates/android_rules.xml
+
+         To customize some build steps for your project:
+         - copy the content of the main node <project> from android_rules.xml
+         - paste it in this build.xml below the <setup /> task.
+         - disable the import by changing the setup task below to <setup import="false" />
+         
+         This will ensure that the properties are setup correctly but that your customized
+         build steps are used.
+    -->
+    <setup />
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/tests/default.properties	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,11 @@
+# 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 use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/tests/local.properties	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,10 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must *NOT* be checked in Version Control Systems,
+# as it contains information specific to your local configuration.
+
+# location of the SDK. This is only used by Ant
+# For customization when using a Version Control System, please read the
+# header note.
+sdk-location=/home/thinker/progm/Android/out/host/freebsd-x86/sdk/android-sdk_eng.thinker_freebsd-x86
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Android/examples/testpath/tests/src/org/madbutterfly/android/examples/testpath/testpathTest.java	Tue Dec 01 22:55:08 2009 +0800
@@ -0,0 +1,21 @@
+package org.madbutterfly.android.examples.testpath;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+ * This is a simple framework for a test of an Application.  See
+ * {@link android.test.ApplicationTestCase ApplicationTestCase} for more information on
+ * how to write and extend Application tests.
+ * <p/>
+ * To run this test, you can type:
+ * adb shell am instrument -w \
+ * -e class org.madbutterfly.android.examples.testpath.testpathTest \
+ * org.madbutterfly.android.examples.testpath.tests/android.test.InstrumentationTestRunner
+ */
+public class testpathTest extends ActivityInstrumentationTestCase2<testpath> {
+
+    public testpathTest() {
+        super("org.madbutterfly.android.examples.testpath", testpath.class);
+    }
+
+}