From d323b4c338106ccedf6dd974e201947eeb2b2d73 Mon Sep 17 00:00:00 2001
From: Dirk Dougherty
Date: Mon, 8 Feb 2010 10:53:12 -0800
Subject: Add generated html docs for SampleSyncAdapter and CubeLiveWallpaper.
Add article for live wallpaper.
Change-Id: Idbeda9a677c9772a8348146fe028083d9887a9d2
---
Android.mk | 6 ++
.../articles/images/live_wallpapers_small.png | Bin 0 -> 152066 bytes
docs/html/resources/articles/index.jd | 5 ++
docs/html/resources/articles/live-wallpapers.jd | 84 +++++++++++++++++++++
docs/html/resources/resources_toc.cs | 21 ++++--
.../samples/images/CubeLiveWallpaper1.png | Bin 0 -> 49522 bytes
.../samples/images/CubeLiveWallpaper3.png | Bin 0 -> 45714 bytes
docs/html/resources/samples/index.jd | 29 ++++---
8 files changed, 130 insertions(+), 15 deletions(-)
create mode 100644 docs/html/resources/articles/images/live_wallpapers_small.png
create mode 100644 docs/html/resources/articles/live-wallpapers.jd
create mode 100644 docs/html/resources/samples/images/CubeLiveWallpaper1.png
create mode 100644 docs/html/resources/samples/images/CubeLiveWallpaper3.png
diff --git a/Android.mk b/Android.mk
index 4c90ecee6855..55748862bc26 100644
--- a/Android.mk
+++ b/Android.mk
@@ -355,6 +355,8 @@ framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:=$(call intermediates-dir-for,JAVA_LIBR
sample_dir := development/samples
+# the list here should match the list of samples included in the sdk samples package
+# (see development/build/sdk.atree)
web_docs_sample_code_flags := \
-hdf android.hasSamples 1 \
-samplecode $(sample_dir)/ApiDemos \
@@ -365,6 +367,8 @@ web_docs_sample_code_flags := \
resources/samples/BusinessCard "Business Card" \
-samplecode $(sample_dir)/ContactManager \
resources/samples/ContactManager "Contact Manager" \
+ -samplecode $(sample_dir)/CubeLiveWallpaper \
+ resources/samples/CubeLiveWallpaper "Live Wallpaper" \
-samplecode $(sample_dir)/Home \
resources/samples/Home "Home" \
-samplecode $(sample_dir)/JetBoy \
@@ -375,6 +379,8 @@ web_docs_sample_code_flags := \
resources/samples/MultiResolution "Multiple Resolutions" \
-samplecode $(sample_dir)/NotePad \
resources/samples/NotePad "Note Pad" \
+ -samplecode $(sample_dir)/SampleSyncAdapter \
+ resources/samples/SampleSyncAdapter "Sample Sync Adapter" \
-samplecode $(sample_dir)/SearchableDictionary \
resources/samples/SearchableDictionary "Searchable Dictionary" \
-samplecode $(sample_dir)/Snake \
diff --git a/docs/html/resources/articles/images/live_wallpapers_small.png b/docs/html/resources/articles/images/live_wallpapers_small.png
new file mode 100644
index 000000000000..3b49b2427005
Binary files /dev/null and b/docs/html/resources/articles/images/live_wallpapers_small.png differ
diff --git a/docs/html/resources/articles/index.jd b/docs/html/resources/articles/index.jd
index 4fda6d739b6a..d2f09961419d 100644
--- a/docs/html/resources/articles/index.jd
+++ b/docs/html/resources/articles/index.jd
@@ -76,6 +76,11 @@ page.title=Technical Articles
Live Folders allow users to display any source of data on their home screen without launching an application. This article discusses how to export an application's data in a format suitable for display inside of a live folder.
+
+ - Live Wallpapers
+ - Live wallpapers are richer, animated, interactive backgrounds that users can display in their home screens. Learn how to create a live wallpaper and bundle it in an application that users can install on their devices.
+
+
- Onscreen Input Methods
- The Input Method Framework (IMF) allows users to take advantage of on-screen input methods, such as software keyboards. This article provides an overview of Input Method Editors (IMEs) and how applications interact with them.
diff --git a/docs/html/resources/articles/live-wallpapers.jd b/docs/html/resources/articles/live-wallpapers.jd
new file mode 100644
index 000000000000..8dda87901d49
--- /dev/null
+++ b/docs/html/resources/articles/live-wallpapers.jd
@@ -0,0 +1,84 @@
+page.title=Live Wallpapers
+@jd:body
+
+Starting with Android 2.1 (API Level 7), users can now enjoy live
+wallpapers — richer, animated, interactive backgrounds — on
+their home screens. A live wallpaper is very similar to a normal Android
+application and has access to all the facilities of the platform: SGL (2D
+drawing), OpenGL (3D drawing), GPS, accelerometers, network access, etc. The
+live wallpapers included on Nexus One demonstrate the use of some of these APIs
+to create fun and interesting user experiences. For instance, the Grass
+wallpaper uses the phone's location to compute sunrise and sunset times in order
+to display the appropriate sky.
+
+
+
+Creating your own live wallpaper is easy, especially if you have had
+previous experience with SurfaceView or Canvas.
+To learn how to create a live wallpaper, you should check out the CubeLiveWallpaper sample code.
+
+In terms of implementation, a live wallpaper is very similar to a regular
+Android service. The
+only difference is the addition of a new method, onCreateEngine(), whose goal is to create a
+WallpaperService.Engine. The engine is responsible for
+handling the lifecycle and drawing of a wallpaper. The system provides a surface
+on which you can draw, just like you would with a SurfaceView.
+Drawing a wallpaper can be very expensive so you should optimize your code
+as much as possible to avoid using too much CPU, not only for battery life
+but also to avoid slowing down the rest of the system. That is also why the
+most important part of the lifecycle of a wallpaper is when it becomes invisible.
+When invisible, such as when the user launches an application that covers
+the home screen, a wallpaper must stop all activity.
+
+The engine can also implement several methods to interact with the user
+or the home application. For instance, if you want your wallpaper to scroll
+along when the user swipes from one home screen to another, you can use onOffsetsChanged().
+To react to touch events, simply implement onTouchEvent(MotionEvent).
+Finally, applications can send arbitrary commands to the live wallpaper.
+Currently, only the standard home application sends commands to the onCommand()
+method of the live wallpaper:
+
+
+android.wallpaper.tap: When the user taps an empty space
+on the workspace. This command is interpreted by the Nexus and Water live
+wallpapers to make the wallpaper react to user interaction. For instance,
+if you tap an empty space on the Water live wallpaper, new ripples appear
+under your finger.
+android.home.drop: When the user drops an icon or a widget
+on the workspace. This command is also interpreted by the Nexus and Water
+live wallpapers.
+
+
+If you are developing a live wallpaper, remember that the feature is
+supported only on Android 2.1 (API level 7) and higher versions of the platform.
+To ensure that your application can only be installed on devices that support
+live wallpapers, remember to add the following to the application's manifest
+before publishing to Android Market:
+
+
+<uses-sdk android:minSdkVersion="7" />, which indicates
+to Android Market and the platform that your application requires Android 2.1 or
+higher. For more information, see the API
+Levels and the documentation for the
+<uses-sdk>
+element.
+<uses-feature android:name="android.software.live_wallpaper" />,
+which tells Android Market that your application includes a live wallpaper
+Android Market uses this feature as a filter, when presenting users lists of
+available applications. When you declaring this feature, Android Market
+displays your application only to users whose devices support live wallpapers,
+while hiding it from other devices on which it would not be able to run. For
+more information, see the documentation for the
+<uses-feature>
+element.
+
+
+Many great live wallpapers are already available on Android Market and
+we can't wait to see more!
diff --git a/docs/html/resources/resources_toc.cs b/docs/html/resources/resources_toc.cs
index e337e385b9a4..097202924d35 100644
--- a/docs/html/resources/resources_toc.cs
+++ b/docs/html/resources/resources_toc.cs
@@ -83,6 +83,9 @@
Live Folders
+
+ Live Wallpapers
+ new!
Onscreen Input Methods
@@ -178,28 +181,34 @@
Bluetooth Chat
- new!
+
Business Card
- new!
+
Contact Manager
- new!
+
Home
JetBoy
+
+ Live Wallpaper
+ new!
Lunar Lander
Multiple Resolutions
- new!
+
Note Pad
+
+ Sample Sync Adapter
+ new!
Searchable Dictionary
@@ -211,10 +220,10 @@
Wiktionary
- new!
+
Wiktionary (Simplified)
- new!
+
diff --git a/docs/html/resources/samples/images/CubeLiveWallpaper1.png b/docs/html/resources/samples/images/CubeLiveWallpaper1.png
new file mode 100644
index 000000000000..55bc1e9ed004
Binary files /dev/null and b/docs/html/resources/samples/images/CubeLiveWallpaper1.png differ
diff --git a/docs/html/resources/samples/images/CubeLiveWallpaper3.png b/docs/html/resources/samples/images/CubeLiveWallpaper3.png
new file mode 100644
index 000000000000..2747a88e5750
Binary files /dev/null and b/docs/html/resources/samples/images/CubeLiveWallpaper3.png differ
diff --git a/docs/html/resources/samples/index.jd b/docs/html/resources/samples/index.jd
index 0beb7815ffd6..5ebf41c2ca98 100644
--- a/docs/html/resources/samples/index.jd
+++ b/docs/html/resources/samples/index.jd
@@ -27,10 +27,10 @@ android update project -s -n API Demos -t <target_ID> -p <pat
platforms) and allow you to view the source files in your browser.
-
Some of the samples in this listing are not yet available in the
- SDK. While we work to update the SDK, you can
- download the latest samples as a ZIP
- archive.
+
Some of the samples in this listing may not yet be available in the
+ SDK. To ensure that you have the latest versions of the samples, you can
+ download the samples pack
+ as a .zip archive.
@@ -55,11 +55,15 @@ platforms) and allow you to view the source files in your browser.
- Home
- A home screen replacement application.
-
+
- JetBoy
- A game that demonstrates the SONiVOX JET interactive music technology,
with {@link android.media.JetPlayer}.
-
+
+ - Live Wallpaper
+ - An application that demonstrates how to create a live wallpaper and
+ bundle it in an application that users can install on their devices.
+
- Lunar Lander
- A classic Lunar Lander game.
@@ -70,14 +74,21 @@ platforms) and allow you to view the source files in your browser.
- Note Pad
- An application for saving notes. Similar (but not identical) to the
Notepad tutorial.
-
+
+ - SampleSyncAdapter
+ - Demonstrates how an application can communicate with a
+cloud-based service and synchronize its data with data stored locally in a
+content provider. The sample uses two related parts of the Android framework
+— the account manager and the synchronization manager (through a sync
+adapter).
+
- Searchable Dictionary
- A sample application that demonstrates Android's search framework,
including how to provide search suggestions for Quick Search Box.
-
+
- Snake
- An implementation of the classic game "Snake."
-
+
- Soft Keyboard
- An example of writing an input method for a software keyboard.
--
cgit v1.2.3-59-g8ed1b