Skip to content

Commit 2f0b1c1

Browse files
committed
Doc change: cherry-pick from master. ->Subject: Android application files for the Activity Testing Tutorial
Conflicts: build/sdk.atree Change-Id: I5edb1d4d8a18fbda53a0e78ca6c9d20cf7d3ff4a
1 parent cf99704 commit 2f0b1c1

File tree

10 files changed

+957
-0
lines changed

10 files changed

+957
-0
lines changed

build/sdk.atree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ development/samples/Snake samples/${PLATFORM_NAME}/Snake
9898
development/samples/SoftKeyboard samples/${PLATFORM_NAME}/SoftKeyboard
9999
development/samples/JetBoy samples/${PLATFORM_NAME}/JetBoy
100100
development/samples/SearchableDictionary samples/${PLATFORM_NAME}/SearchableDictionaryV2
101+
development/samples/Spinner samples/${PlATFORM_NAME}/Spinner
102+
development/samples/SpinnerTest samples/${PLATFORM_NAME}/SpinnerTest
101103
development/samples/ContactManager samples/${PLATFORM_NAME}/ContactManager
102104
development/samples/MultiResolution samples/${PLATFORM_NAME}/MultiResolution
103105
development/samples/Wiktionary samples/${PLATFORM_NAME}/Wiktionary
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2010 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<!--
18+
Declares the contents of this Android application. The "namespace"
19+
attribute brings in the Android platform namespace, and the
20+
"package" attribute provides a unique Android name for the application.
21+
If you use this file as a template in your own application, you must change
22+
the package name from "com.android.example" to one that you own or have
23+
control over.
24+
-->
25+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
26+
package="com.android.example.spinner"
27+
android:versionCode="1"
28+
android:versionName="1.0">
29+
<!--
30+
Sets the application's user-readable label
31+
-->
32+
<application android:label="@string/app_name">
33+
<!--
34+
Sets the activity's name and label
35+
-->
36+
<activity android:name=".SpinnerActivity"
37+
android:label="@string/app_name">
38+
<!--
39+
This activity responds to MAIN and LAUNCHER intents
40+
-->
41+
<intent-filter>
42+
<action android:name="android.intent.action.MAIN" />
43+
<category android:name="android.intent.category.LAUNCHER" />
44+
</intent-filter>
45+
</activity>
46+
47+
</application>
48+
<!--
49+
Requires a minimum platform version of Android-3 (SDK 1.5) to run
50+
-->
51+
<uses-sdk android:minSdkVersion="3"/>
52+
53+
</manifest>

samples/Spinner/_index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<p>
2+
This sample is the application under test for the
3+
<a href="../../../resources/tutorials/testing/activity_test.html">Activity
4+
Testing Tutorial</a>. It contains a single Activity that displays a
5+
Spinner widget backed by an array of strings containing the names of the planets
6+
in the Solar System. When an entry is selected from the Spinner, the entry is
7+
displayed in a text box.
8+
</p>
9+
<p>
10+
An important part of this application is state management. When the application
11+
is first run, the spinner widget displays a default selection of
12+
&quot;Earth&quot;. Thereafter, the application saves a selection as soon as it
13+
is made. The application remembers the selection from invocation to invocation, even
14+
if the device reboots.
15+
</p>
16+
<p>
17+
For more information about this application, see the Activity Testing Tutorial.
18+
The test application for this application is in the <a
19+
href="../SpinnerTest/index.html">SpinnerTest</a> sample application.
20+
</p>
21+
22+
<img alt="The Spinner application" src="../images/testing/spinner_main_screen.png" />
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2010 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<!--
18+
Creates a Linear Layout View to contain the spinner
19+
-->
20+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:orientation="vertical"
22+
android:layout_width="fill_parent"
23+
android:layout_height="fill_parent"
24+
>
25+
26+
<!--
27+
Creates a spinner widget called Spinner01, within the Linear Layout
28+
The prompt text comes from the string "planet_prompt" in strings.xml
29+
-->
30+
<Spinner
31+
android:id="@+id/Spinner01"
32+
android:layout_height="wrap_content"
33+
android:layout_width="fill_parent"
34+
android:drawSelectorOnTop = "true"
35+
android:prompt = "@string/planet_prompt">
36+
</Spinner>
37+
38+
<!--
39+
Creates a TextView called SpinnerResult, below the spinner.
40+
-->
41+
<TextView
42+
android:id="@+id/SpinnerResult" android:text="Result"
43+
android:layout_height="fill_parent" android:textSize="10pt"
44+
android:textStyle="bold" android:gravity="center"
45+
android:layout_width="fill_parent">
46+
</TextView>
47+
48+
</LinearLayout>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2010 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<!--
18+
The string named "app_name" defines the application's visible name.
19+
The string array "Planets" defines an array of 9 strings. The application loads
20+
this array into the spinner's array adapter.
21+
The string "planet_prompt" defines the prompt for the result text box.
22+
-->
23+
<resources>
24+
<string name="app_name">Spinner</string>
25+
<string-array name="Planets">
26+
<item>Mercury</item>
27+
<item>Venus</item>
28+
<item>Earth</item>
29+
<item>Mars</item>
30+
<item>Jupiter</item>
31+
<item>Saturn</item>
32+
<item>Uranus</item>
33+
<item>Neptune</item>
34+
<item>Pluto</item>
35+
</string-array>
36+
<string name="planet_prompt">Select a planet</string>
37+
</resources>

0 commit comments

Comments
 (0)