From 6c4f5c561d662456f55830a554c51c3d9670d094 Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Wed, 29 Feb 2012 15:54:36 -0800 Subject: Move Android project with Java project dep test to its own folder. Also make it more complex: - java project references a jar file. - 2 libs depend on the java project - app project only reference the libs, not the java project (it still does but indirectly). Change-Id: I8fc53e0f868ce014ea99486e7b1fa6fe0f197daa --- testapps/javaProjectTest/app/.classpath | 8 +++++ testapps/javaProjectTest/app/.project | 33 +++++++++++++++++++++ testapps/javaProjectTest/app/AndroidManifest.xml | 23 ++++++++++++++ testapps/javaProjectTest/app/project.properties | 16 ++++++++++ .../javaProjectTest/app/res/drawable-hdpi/icon.png | Bin 0 -> 4147 bytes .../javaProjectTest/app/res/drawable-ldpi/icon.png | Bin 0 -> 1723 bytes .../javaProjectTest/app/res/drawable-mdpi/icon.png | Bin 0 -> 2574 bytes testapps/javaProjectTest/app/res/layout/main.xml | 18 +++++++++++ .../javaProjectTest/app/res/values/strings.xml | 4 +++ .../android/tests/basicProjectWithJava/Main.java | 22 ++++++++++++++ .../tests/basicProjectWithJava/MyTextView.java | 27 +++++++++++++++++ 11 files changed, 151 insertions(+) create mode 100644 testapps/javaProjectTest/app/.classpath create mode 100644 testapps/javaProjectTest/app/.project create mode 100644 testapps/javaProjectTest/app/AndroidManifest.xml create mode 100644 testapps/javaProjectTest/app/project.properties create mode 100644 testapps/javaProjectTest/app/res/drawable-hdpi/icon.png create mode 100644 testapps/javaProjectTest/app/res/drawable-ldpi/icon.png create mode 100644 testapps/javaProjectTest/app/res/drawable-mdpi/icon.png create mode 100644 testapps/javaProjectTest/app/res/layout/main.xml create mode 100644 testapps/javaProjectTest/app/res/values/strings.xml create mode 100644 testapps/javaProjectTest/app/src/com/android/tests/basicProjectWithJava/Main.java create mode 100644 testapps/javaProjectTest/app/src/com/android/tests/basicProjectWithJava/MyTextView.java (limited to 'testapps/javaProjectTest/app') diff --git a/testapps/javaProjectTest/app/.classpath b/testapps/javaProjectTest/app/.classpath new file mode 100644 index 0000000..a4763d1 --- /dev/null +++ b/testapps/javaProjectTest/app/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/testapps/javaProjectTest/app/.project b/testapps/javaProjectTest/app/.project new file mode 100644 index 0000000..69b06f5 --- /dev/null +++ b/testapps/javaProjectTest/app/.project @@ -0,0 +1,33 @@ + + + app + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/testapps/javaProjectTest/app/AndroidManifest.xml b/testapps/javaProjectTest/app/AndroidManifest.xml new file mode 100644 index 0000000..0ccbb84 --- /dev/null +++ b/testapps/javaProjectTest/app/AndroidManifest.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testapps/javaProjectTest/app/project.properties b/testapps/javaProjectTest/app/project.properties new file mode 100644 index 0000000..52891d4 --- /dev/null +++ b/testapps/javaProjectTest/app/project.properties @@ -0,0 +1,16 @@ +# 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-15 +android.library.reference.1=../lib1 +android.library.reference.2=../lib2 diff --git a/testapps/javaProjectTest/app/res/drawable-hdpi/icon.png b/testapps/javaProjectTest/app/res/drawable-hdpi/icon.png new file mode 100644 index 0000000..8074c4c Binary files /dev/null and b/testapps/javaProjectTest/app/res/drawable-hdpi/icon.png differ diff --git a/testapps/javaProjectTest/app/res/drawable-ldpi/icon.png b/testapps/javaProjectTest/app/res/drawable-ldpi/icon.png new file mode 100644 index 0000000..1095584 Binary files /dev/null and b/testapps/javaProjectTest/app/res/drawable-ldpi/icon.png differ diff --git a/testapps/javaProjectTest/app/res/drawable-mdpi/icon.png b/testapps/javaProjectTest/app/res/drawable-mdpi/icon.png new file mode 100644 index 0000000..a07c69f Binary files /dev/null and b/testapps/javaProjectTest/app/res/drawable-mdpi/icon.png differ diff --git a/testapps/javaProjectTest/app/res/layout/main.xml b/testapps/javaProjectTest/app/res/layout/main.xml new file mode 100644 index 0000000..670dd32 --- /dev/null +++ b/testapps/javaProjectTest/app/res/layout/main.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/testapps/javaProjectTest/app/res/values/strings.xml b/testapps/javaProjectTest/app/res/values/strings.xml new file mode 100644 index 0000000..96d8724 --- /dev/null +++ b/testapps/javaProjectTest/app/res/values/strings.xml @@ -0,0 +1,4 @@ + + + basicProjectWithJava + diff --git a/testapps/javaProjectTest/app/src/com/android/tests/basicProjectWithJava/Main.java b/testapps/javaProjectTest/app/src/com/android/tests/basicProjectWithJava/Main.java new file mode 100644 index 0000000..eb6be25 --- /dev/null +++ b/testapps/javaProjectTest/app/src/com/android/tests/basicProjectWithJava/Main.java @@ -0,0 +1,22 @@ +package com.android.tests.basicProjectWithJava; + +import com.android.tests.basicJavaProject.Foo; + +import android.app.Activity; +import android.os.Bundle; +import android.widget.TextView; + +public class Main extends Activity { + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + + Foo foo = new Foo(); + + TextView tv = (TextView) findViewById(R.id.text); + tv.setText("basicProjectWithJava\nvalue from java project:" + foo.getRandomFoo()); + } + +} \ No newline at end of file diff --git a/testapps/javaProjectTest/app/src/com/android/tests/basicProjectWithJava/MyTextView.java b/testapps/javaProjectTest/app/src/com/android/tests/basicProjectWithJava/MyTextView.java new file mode 100644 index 0000000..ae35dca --- /dev/null +++ b/testapps/javaProjectTest/app/src/com/android/tests/basicProjectWithJava/MyTextView.java @@ -0,0 +1,27 @@ +package com.android.tests.basicProjectWithJava; + +import com.android.tests.basicJavaProject.Foo; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.TextView; + +public class MyTextView extends TextView { + + public MyTextView(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + + Foo f = new Foo(); + setText("Foo: " + f.getRandomFoo()); + } + + public MyTextView(Context context, AttributeSet attrs) { + super(context, attrs); + Foo f = new Foo(); + setText("Foo: " + f.getRandomFoo()); + } + + public MyTextView(Context context) { + super(context); + } +} -- cgit v1.1