diff options
author | Xavier Ducrohet <xav@android.com> | 2012-02-29 15:54:36 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2012-02-29 16:00:40 -0800 |
commit | 6c4f5c561d662456f55830a554c51c3d9670d094 (patch) | |
tree | d8a1fdc401ad02a8ae8099ea134272afa3ce1e8e /testapps/javaProjectTest/app | |
parent | dd3f3c4fa0dc0bd5033f891ab005925343c146b7 (diff) | |
download | sdk-6c4f5c561d662456f55830a554c51c3d9670d094.zip sdk-6c4f5c561d662456f55830a554c51c3d9670d094.tar.gz sdk-6c4f5c561d662456f55830a554c51c3d9670d094.tar.bz2 |
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
Diffstat (limited to 'testapps/javaProjectTest/app')
-rw-r--r-- | testapps/javaProjectTest/app/.classpath | 8 | ||||
-rw-r--r-- | testapps/javaProjectTest/app/.project | 33 | ||||
-rw-r--r-- | testapps/javaProjectTest/app/AndroidManifest.xml | 23 | ||||
-rw-r--r-- | testapps/javaProjectTest/app/project.properties | 16 | ||||
-rw-r--r-- | testapps/javaProjectTest/app/res/drawable-hdpi/icon.png | bin | 0 -> 4147 bytes | |||
-rw-r--r-- | testapps/javaProjectTest/app/res/drawable-ldpi/icon.png | bin | 0 -> 1723 bytes | |||
-rw-r--r-- | testapps/javaProjectTest/app/res/drawable-mdpi/icon.png | bin | 0 -> 2574 bytes | |||
-rw-r--r-- | testapps/javaProjectTest/app/res/layout/main.xml | 18 | ||||
-rw-r--r-- | testapps/javaProjectTest/app/res/values/strings.xml | 4 | ||||
-rw-r--r-- | testapps/javaProjectTest/app/src/com/android/tests/basicProjectWithJava/Main.java | 22 | ||||
-rw-r--r-- | testapps/javaProjectTest/app/src/com/android/tests/basicProjectWithJava/MyTextView.java | 27 |
11 files changed, 151 insertions, 0 deletions
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 @@ +<?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/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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>app</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/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 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.tests.basicProjectWithJava" + android:versionCode="1" + android:versionName="1.0" > + + <uses-sdk android:minSdkVersion="15" /> + + <application + android:icon="@drawable/icon" + android:label="@string/app_name" > + <activity + android:name="Main" + 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/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 Binary files differnew file mode 100644 index 0000000..8074c4c --- /dev/null +++ b/testapps/javaProjectTest/app/res/drawable-hdpi/icon.png diff --git a/testapps/javaProjectTest/app/res/drawable-ldpi/icon.png b/testapps/javaProjectTest/app/res/drawable-ldpi/icon.png Binary files differnew file mode 100644 index 0000000..1095584 --- /dev/null +++ b/testapps/javaProjectTest/app/res/drawable-ldpi/icon.png diff --git a/testapps/javaProjectTest/app/res/drawable-mdpi/icon.png b/testapps/javaProjectTest/app/res/drawable-mdpi/icon.png Binary files differnew file mode 100644 index 0000000..a07c69f --- /dev/null +++ b/testapps/javaProjectTest/app/res/drawable-mdpi/icon.png 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 @@ +<?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="basicProjectWithJava" + android:id="@+id/text" + /> +<com.android.tests.basicProjectWithJava.MyTextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:id="@+id/text" + /> +</LinearLayout> 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 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="app_name">basicProjectWithJava</string> +</resources> 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); + } +} |