diff --git a/samples/Alarm/AndroidManifest.xml b/samples/Alarm/AndroidManifest.xml new file mode 100644 index 000000000..6a7a831a8 --- /dev/null +++ b/samples/Alarm/AndroidManifest.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + diff --git a/samples/Alarm/_index.html b/samples/Alarm/_index.html new file mode 100644 index 000000000..dff51ce94 --- /dev/null +++ b/samples/Alarm/_index.html @@ -0,0 +1,29 @@ +

+ This sample is a revised version of the AlarmService functionality included in the + ApiDemos sample application. It is used as the application under test + for the Alarm Service Test + sample test application. +

+

+ This application demonstrates a simple Android service that is started when needed by + Context.startService(Intent) and stops itself when its work is done. You can + use this type of service to move long-running or periodic tasks into the background. For + example, you could use this type of service to perform data synchronization. +

+

+ In the sample, the service simply runs for 15 seconds and then stops itself. The wait is + implemented in a separate thread that uses a thread-safe object. This illustrates how to + set up a service that runs multiple threads that depend on one or more objects that must be + made thread-safe. +

+

+ The application also contains the AlarmActivity activity that is a client of the + service. You use the activity to control when the service starts and stops. By default, the + activity fires off the service every thirty seconds. In effect, the service starts after + thirty seconds, runs for 15 seconds, stops, and then runs again automatically in another + 15 seconds. You also use the client to stop this cycle. +

+

+ The test application AlarmServiceTest + shows you how to set up a test of this service. +

diff --git a/samples/Alarm/res/drawable/icon.png b/samples/Alarm/res/drawable/icon.png new file mode 100644 index 000000000..5ae7701a8 Binary files /dev/null and b/samples/Alarm/res/drawable/icon.png differ diff --git a/samples/Alarm/res/drawable/stat_sample.png b/samples/Alarm/res/drawable/stat_sample.png new file mode 100755 index 000000000..6c9ba0a97 Binary files /dev/null and b/samples/Alarm/res/drawable/stat_sample.png differ diff --git a/samples/Alarm/res/layout/main.xml b/samples/Alarm/res/layout/main.xml new file mode 100644 index 000000000..3d79e2ba5 --- /dev/null +++ b/samples/Alarm/res/layout/main.xml @@ -0,0 +1,44 @@ + + + + + + + + + +