Merge branch 'master' of ssh://android-git.corp.google.com:29418/platform/frameworks/base
This commit is contained in:
@@ -97,7 +97,7 @@ page.title=Reference of Available Intents
|
||||
the fisheye lens effect that would be present if a 90 degree horizontal
|
||||
FOV was used in portrait mode.</td></tr>
|
||||
<tr><td>mapZoom</td><td>The map zoom of the map location associated with this panorama. This value is passed on to the
|
||||
Maps activity when the Street View "Go to Maps" menu item is chosen. It corresponds to the <em>z</em> paramaeter in
|
||||
Maps activity when the Street View "Go to Maps" menu item is chosen. It corresponds to the <em>z</em> parameter in
|
||||
the geo: intent.</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
@@ -328,7 +328,7 @@ loopback interface.
|
||||
<p>The listening classes, called broadcast receivers, extend {@link android.content.BroadcastReceiver
|
||||
BroadcastReceiver}. If you want Android to instantiate the object whenever an appropriate
|
||||
intent notification is sent, define the receiver with a <code><receiver></code> element
|
||||
in the AndroidManifext.xml file. If the caller is expected to instantiate the
|
||||
in the AndroidManifest.xml file. If the caller is expected to instantiate the
|
||||
object in preparation to receive a message, this is not required. The receiver
|
||||
will get a call to their {@link android.content.BroadcastReceiver#onReceive(android.content.Context,android.content.Intent)
|
||||
BroadcastReceiver.onReceive()} method. A receiver can define an <code><intent-filter></code> tag
|
||||
@@ -468,7 +468,7 @@ user receiving new e-mail.</p>
|
||||
};
|
||||
|
||||
|
||||
private void IncomingMotherInlawCall(Connection c) {
|
||||
private void IncomingMotherInLawCall(Connection c) {
|
||||
String Text;
|
||||
|
||||
// "Answer" callback.
|
||||
@@ -486,7 +486,7 @@ private void IncomingMotherInlawCall(Connection c) {
|
||||
new AlertDialog.Builder(this)
|
||||
.setMessage("Phyllis is calling")
|
||||
.setPositiveButton("Answer", acceptMsg)
|
||||
.setOnCanceListener(new OnCancelListener() {
|
||||
.setOnCancelListener(new OnCancelListener() {
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
rejectMsg.sendToTarget();
|
||||
}});
|
||||
|
||||
@@ -103,7 +103,7 @@ narrower than in landscape mode. This is done to minimize the fisheye lens
|
||||
effect that would be present if a 90 degree horizontal FOV was used in portrait
|
||||
mode.</td></tr>
|
||||
<tr><td><em>mapZoom</em></td><td>The map zoom of the map location associated with this panorama. This value is passed on to the
|
||||
Maps activity when the Street View "Go to Maps" menu item is chosen. It corresponds to the <em>z</em> paramaeter in
|
||||
Maps activity when the Street View "Go to Maps" menu item is chosen. It corresponds to the <em>z</em> parameter in
|
||||
the geo: intent.</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
@@ -167,7 +167,7 @@ page.title=Glossary
|
||||
<dd>An XML file that each application must define, to describe the
|
||||
application's package name, version, components (activities, intent
|
||||
filters, services), imported libraries, and describes the various
|
||||
activies, and so on. See <a
|
||||
activities, and so on. See <a
|
||||
href="{@docRoot}guide/topics/manifest/manifest-intro.html">The
|
||||
AndroidManifest.xml File</a> for complete information.</dd>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ applications:</p>
|
||||
<ul>
|
||||
<li>It gives you access to other Android development tools from inside the Eclipse IDE. For
|
||||
example, ADT lets you access the many capabilities of the DDMS tool: take screenshots, manage
|
||||
port-forwarding, set breakpoints, and view thread and process informationd irectly from Eclipse.</li>
|
||||
port-forwarding, set breakpoints, and view thread and process information directly from Eclipse.</li>
|
||||
<li>It provides a New Project Wizard, which helps you quickly create and set up all of the
|
||||
basic files you'll need for a new Android application.</li>
|
||||
<li>It automates and simplifies the process of building your Android application.</li>
|
||||
@@ -145,7 +145,7 @@ create an AVD.</p>
|
||||
<p>If you will be running your applications only on actual device hardware, you do not
|
||||
need an AVD — see
|
||||
<a href="{@docRoot}guide/developing/device.html">Developing On a Device</a> for information
|
||||
on running your applicaiton.</p>
|
||||
on running your application.</p>
|
||||
|
||||
<h3 id="CreatingAnAvd">Creating an AVD</h3>
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ android create project \
|
||||
<li><code>default.properties</code> - Properties for the build system. <em>Do not modify
|
||||
this file</em>.</li>
|
||||
<li><code>build.properties</code> - Customizable properties for the build system. You can edit this
|
||||
file to overried default build settings used by Ant.</li>
|
||||
file to override default build settings used by Ant.</li>
|
||||
<li><code>src<em>/your/package/namespace/ActivityName</em>.java</code> - The Activity class
|
||||
you specified during project creation.</li>
|
||||
<li><code>bin/</code> - Output directory for the build script.</li>
|
||||
@@ -230,7 +230,7 @@ environment variable to specify the path to where the JDK is installed.</p>
|
||||
<p class="note"><strong>Note:</strong> When installing JDK on Windows, the default is to install
|
||||
in the "Program Files" directory. This location will cause <code>ant</code> to fail, because of
|
||||
the space. To fix the problem, you can specify the JAVA_HOME variable like this:
|
||||
<code>set JAVA_HOME=c:\Prora~1\Java\<jdkdir></code>. The easiest solution, however, is to
|
||||
<code>set JAVA_HOME=c:\Progra~1\Java\<jdkdir></code>. The easiest solution, however, is to
|
||||
install JDK in a non-space directory, for example: <code>c:\java\jdk1.6.0_02</code>.</p>
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ Emulator 2, adb: 5557 ...
|
||||
|
||||
<p>Once the server has set up connections to all emulator instances, you can use adb commands to control and access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).</p>
|
||||
|
||||
<p>The sections below describe the commands that you can use to access adb capabilities and manage the state of an emulator/device. Note that if you are developing Android applications in Eclipse and have installed the ADT plugin, you do not need to access adb from the command line. The ADT plugin provides a trasparent integration of adb into the Eclipse IDE. However, you can still use adb directly as necessary, such as for debugging.</p>
|
||||
<p>The sections below describe the commands that you can use to access adb capabilities and manage the state of an emulator/device. Note that if you are developing Android applications in Eclipse and have installed the ADT plugin, you do not need to access adb from the command line. The ADT plugin provides a transparent integration of adb into the Eclipse IDE. However, you can still use adb directly as necessary, such as for debugging.</p>
|
||||
|
||||
<a name="issuingcommands"></a>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ page.title=ADT Plugin
|
||||
<p>The Android Development Tools (ADT) plugin adds powerful extensions to the Eclipse integrated development environment. It allows you to create and debug your Android applications easier and faster. If you use Eclipse, the ADT plugin gives you an incredible boost in developing Android applications:</p>
|
||||
|
||||
<ul>
|
||||
<li>It gives you access to other Android development tools from inside the Eclipse IDE. For example, ADT lets you access the many capabilities of the DDMS tool: take screenshots, manage port-forwarding, set breakpoints, and view thread and process informationd irectly from Eclipse.</li>
|
||||
<li>It gives you access to other Android development tools from inside the Eclipse IDE. For example, ADT lets you access the many capabilities of the DDMS tool: take screenshots, manage port-forwarding, set breakpoints, and view thread and process information directly from Eclipse.</li>
|
||||
<li>It provides a New Project Wizard, which helps you quickly create and set up all of the basic files you'll need for a new Android application.</li>
|
||||
<li>It automates and simplifies the process of building your Android application.</li>
|
||||
<li>It provides an Android code editor that helps you write valid XML for your Android manifest and resource files.</li>
|
||||
@@ -102,7 +102,7 @@ Note that to update your plugin, you will have to follow these steps again inste
|
||||
|
||||
<p>Note that the "Android Editors" feature of ADT requires several optional
|
||||
Eclipse components (for example, WST). If you encounter an error when
|
||||
installing ADT, your Eclipse installion might not include those components.
|
||||
installing ADT, your Eclipse installation might not include those components.
|
||||
For information about how to quickly add the necessary components to your
|
||||
Eclipse installation, see the troubleshooting topic
|
||||
<a href="{@docRoot}guide/appendix/faq/troubleshooting.html#installeclipsecomponents">ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui"</a>.</p>
|
||||
|
||||
@@ -5,7 +5,7 @@ page.title=Draw 9-patch
|
||||
{@link android.graphics.NinePatch} graphic using a WYSIWYG editor.</p>
|
||||
<p>For an introduction to Nine-patch graphics and how they work, please read
|
||||
the section on Nine-patch in the
|
||||
<a href="{@docRoot}guide/topics/resources/available-resources.html#ninepatch">Ninepatch Images</a> topic.</p>
|
||||
<a href="{@docRoot}guide/topics/resources/available-resources.html#ninepatch">Nine-patch Images</a> topic.</p>
|
||||
|
||||
<div class="sidebox" style="width:auto"><br/>
|
||||
<img src="{@docRoot}images/draw9patch-norm.png" alt="" height="300" width="341" />
|
||||
|
||||
@@ -1334,7 +1334,7 @@ B:10.0.2.15:<serverPort></code></li>
|
||||
|
||||
<p>You can use the <code>power</code> command to control the simulated power state of the emulator instance.The usage for the command is: </p>
|
||||
|
||||
<pre>power <display|ac|status|present|health|capactiy></pre>
|
||||
<pre>power <display|ac|status|present|health|capacity></pre>
|
||||
|
||||
<p>The <code>event</code> command supports the subcommands listed in the table below. </p>
|
||||
|
||||
@@ -1389,7 +1389,7 @@ B:10.0.2.15:<serverPort></code></li>
|
||||
<a name="netdelay"></a>
|
||||
<h3>Network Delay Emulation</h3>
|
||||
|
||||
<p>The emulator lets you simulate various network latency levels, so that you can test your applicaton in an environment more typical of the actual conditions in which it will run. You can set a latency level or range at emulator startup or you can use the console to change the latency dynamically, while the application is running in the emulator. </p>
|
||||
<p>The emulator lets you simulate various network latency levels, so that you can test your application in an environment more typical of the actual conditions in which it will run. You can set a latency level or range at emulator startup or you can use the console to change the latency dynamically, while the application is running in the emulator. </p>
|
||||
<p>To set latency at emulator startup, use the <code>-netdelay</code> emulator option with a supported <code><delay></code> value, as listed in the table below. Here are some examples:</p>
|
||||
<pre>emulator -netdelay gprs
|
||||
emulator -netdelay 40 100</pre>
|
||||
|
||||
@@ -80,7 +80,7 @@ responsive to input and thus avoid ANR dialogs caused by the 5 second input
|
||||
event timeout. These same practices should be followed for any other threads
|
||||
that display UI, as they are also subject to the same timeouts.</p>
|
||||
|
||||
<p>The specific constraint on IntentReciever execution time emphasizes what
|
||||
<p>The specific constraint on IntentReceiver execution time emphasizes what
|
||||
they were meant to do: small, discrete amounts of work in the background such
|
||||
as saving a setting or registering a Notification. So as with other methods
|
||||
called in the main thread, applications should avoid potentially long-running
|
||||
|
||||
@@ -469,7 +469,7 @@ page.title=Activity and Task Design Guidelines
|
||||
re-use activities in other applications, and how your activities might
|
||||
be re-used by other applications. If you add an activity with the same
|
||||
<a href=#intents title="intent filter">intent filter</a> as an
|
||||
exisiting activity, then the system presents the user with a choice
|
||||
existing activity, then the system presents the user with a choice
|
||||
between the activities.
|
||||
</p>
|
||||
|
||||
@@ -879,7 +879,7 @@ page.title=Activity and Task Design Guidelines
|
||||
<p>
|
||||
You can either test that an activity matches the intent, which you can do
|
||||
before starting the activity, or catch an exception if starting the
|
||||
activity fails. Both approaches are descibed in the blog posting
|
||||
activity fails. Both approaches are described in the blog posting
|
||||
<a href="http://android-developers.blogspot.com/2009/01/can-i-use-this-intent.html">Can
|
||||
I use this Intent?</a>.
|
||||
</p>
|
||||
@@ -938,7 +938,7 @@ page.title=Activity and Task Design Guidelines
|
||||
the menus, the system compares the "Share" request (an Intent
|
||||
object) to available activities (by looking at their intent
|
||||
filters) and displays choices to share. In this case, it
|
||||
matches Email, Gmail, Messaging and Picassa. If your activity
|
||||
matches Email, Gmail, Messaging and Picasa. If your activity
|
||||
can send a picture or upload it to a website, all it needs to
|
||||
do is make itself available for sharing (by setting its intent
|
||||
filter).
|
||||
@@ -978,7 +978,7 @@ page.title=Activity and Task Design Guidelines
|
||||
<li>
|
||||
<b>Launch your activity <em>only</em> from within another
|
||||
application</b> - The previous cases of sharing by way of
|
||||
Email, Gmail, Messaging and Picassa (from within Gallery) are
|
||||
Email, Gmail, Messaging and Picasa (from within Gallery) are
|
||||
all activities that can also be started from icons in the
|
||||
application launcher at Home. In contrast, the activities for
|
||||
cropping a picture and attaching a file cannot be started from
|
||||
|
||||
@@ -9,7 +9,7 @@ page.title=Widget Design Guidelines
|
||||
<ul>
|
||||
<li>Widgets have six standard sizes on the Home screen</li>
|
||||
<li>Widgets have standards for size, frames, shadows, and file format, which you can copy</li>
|
||||
<li>A few tricks make it easier to design widgets that fit graphically on the Home screeen</li>
|
||||
<li>A few tricks make it easier to design widgets that fit graphically on the Home screen</li>
|
||||
</ul>
|
||||
|
||||
<h2>In this document</h2>
|
||||
|
||||
@@ -67,7 +67,7 @@ always define values for both of them: </p>
|
||||
<li><code>android:versionCode</code> — An integer value that represents
|
||||
the version of the application code, relative to other versions.
|
||||
|
||||
<p>The value is an integer so that other applications can programatically
|
||||
<p>The value is an integer so that other applications can programmatically
|
||||
evaluate it, for example to check an upgrade or downgrade relationship. You can
|
||||
set the value to any integer you want, however you should make sure that each
|
||||
successive release of your application uses a greater value. The system does not
|
||||
@@ -78,7 +78,7 @@ normative. </p>
|
||||
versionCode set to 1, then monotonically increase the value with each release,
|
||||
regardless whether the release constitutes a major or minor release. This means
|
||||
that the <code>android:versionCode</code> value does not necessarily have a
|
||||
strong resemblence to the application release version that is visible to the
|
||||
strong resemblance to the application release version that is visible to the
|
||||
user (see <code>android:versionName</code>, below). Applications and publishing
|
||||
services should not display this version value to users.</p>
|
||||
</li>
|
||||
|
||||
@@ -382,7 +382,7 @@ so the Activity needs to accept this Intent. For example:</p>
|
||||
|
||||
<p>Also, the Activity must be declared in the AppWidgetProviderInfo XML file, with the
|
||||
<code>android:configure</code> attribute (see <a href="#MetaData">Adding
|
||||
the AppWidgetProvierInfo Metadata</a> above). For example, the configuration Activity
|
||||
the AppWidgetProviderInfo Metadata</a> above). For example, the configuration Activity
|
||||
can be declared like this:</p>
|
||||
|
||||
<pre>
|
||||
|
||||
@@ -262,7 +262,7 @@ camera button has been pressed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There are separate methods for activiating each type of component:
|
||||
There are separate methods for activating each type of component:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
@@ -43,7 +43,7 @@ including {@link android.graphics.drawable.BitmapDrawable}, {@link android.graph
|
||||
{@link android.graphics.drawable.PictureDrawable}, {@link android.graphics.drawable.LayerDrawable}, and several more.
|
||||
Of course, you can also extend these to define your own custom Drawable objects that behave in unique ways.</p>
|
||||
|
||||
<p>There are three ways to define and instantiate a Drawable: using an image saved in your project resouces;
|
||||
<p>There are three ways to define and instantiate a Drawable: using an image saved in your project resources;
|
||||
using an XML file that defines the Drawable properties; or using the normal class constructors. Below, we'll discuss
|
||||
each the first two techniques (using constructors is nothing new for an experienced developer).</p>
|
||||
|
||||
@@ -126,7 +126,7 @@ instead of directly transforming the Drawable, you should perform a <a href="#tw
|
||||
<a href="{@docRoot}guide/topics/ui/index.html">User Interface</a>. Hence, you understand the power
|
||||
and flexibility inherent in defining objects in XML. This philosophy caries over from Views to Drawables.
|
||||
If there is a Drawable object that you'd like to create, which is not initially dependent on variables defined by
|
||||
your applicaton code or user interaction, then defining the Drawable in XML is a good option.
|
||||
your application code or user interaction, then defining the Drawable in XML is a good option.
|
||||
Even if you expect your Drawable to change its properties during the user's experience with your application,
|
||||
you should consider defining the object in XML, as you can always modify properties once it is instantiated.</p>
|
||||
|
||||
@@ -206,7 +206,7 @@ public class CustomDrawableView extends View {
|
||||
It's then given a color and the bounds of the shape are set. If you do not set the bounds, then the
|
||||
shape will not be drawn, whereas if you don't set the color, it will default to black.</p>
|
||||
<p>With the custom View defined, it can be drawn any way you like. With the sample above, we can
|
||||
draw the shape progammatically in an Activity:</p>
|
||||
draw the shape programmatically in an Activity:</p>
|
||||
<pre>
|
||||
CustomDrawableView mCustomDrawableView;
|
||||
|
||||
@@ -248,7 +248,7 @@ of the object it's attached to.
|
||||
<h2 id="nine-patch">NinePatchDrawable</h2>
|
||||
|
||||
<p>A {@link android.graphics.drawable.NinePatchDrawable} graphic is a stretchable bitmap image, which Android
|
||||
will automatically resize to accomodate the contents of the View in which you have placed it as the background.
|
||||
will automatically resize to accommodate the contents of the View in which you have placed it as the background.
|
||||
An example use of a NinePatch is the backgrounds used by standard Android buttons —
|
||||
buttons must stretch to accommodate strings of various lengths. A NinePatch drawable is a standard PNG
|
||||
image that includes an extra 1-pixel-wide border. It must be saved with the extension <code>.9.png</code>,
|
||||
@@ -271,7 +271,7 @@ and saved into the <code>res/drawable/</code> directory of your project.
|
||||
define this drawable area.
|
||||
</p>
|
||||
<p>To clarify the difference between the different lines, the left and top lines define
|
||||
which pixels of the image are allowed to be replicated in order to strech the image.
|
||||
which pixels of the image are allowed to be replicated in order to stretch the image.
|
||||
The bottom and right lines define the relative area within the image that the contents
|
||||
of the View are allowed to lie within.</p>
|
||||
<p>
|
||||
@@ -281,7 +281,7 @@ of the View are allowed to lie within.</p>
|
||||
|
||||
<p>This NinePatch defines one stretchable area with the left and top lines
|
||||
and the drawable area with the bottom and right lines. In the top image, the dotted grey
|
||||
lines identify the regions of the image that will be replicated in order to strech the image. The pink
|
||||
lines identify the regions of the image that will be replicated in order to stretch the image. The pink
|
||||
rectangle in the bottom image identifies the region in which the contents of the View are allowed.
|
||||
If the contents don't fit in this region, then the image will be stretched so that they do.
|
||||
</p>
|
||||
@@ -333,7 +333,7 @@ the contents of a View object. So, if you have a TextView object, you can move,
|
||||
If it has a background image, the background image will be transformed along with the text.
|
||||
The {@link android.view.animation animation package} provides all the classes used in a tween animation.</p>
|
||||
|
||||
<p>A sequence of animation instructions defines the twen animation, defined by either XML or Android code.
|
||||
<p>A sequence of animation instructions defines the tween animation, defined by either XML or Android code.
|
||||
Like defining a layout, an XML file is recommended because it's more readable, reusable, and swappable
|
||||
than hard-coding the animation. In the example below, we use XML. (To learn more about defining an animation
|
||||
in your application code, instead of XML, refer to the
|
||||
@@ -428,7 +428,7 @@ then assign the animation to the View with
|
||||
in the <a href="{@docRoot}guide/topics/resources/available-resources.html#animation">Available Resources</a>.</p>
|
||||
|
||||
<p class="note"><strong>Note:</strong> Regardless of how your animation may move or resize, the bounds of the
|
||||
View that holds your animation will not automatically adjust to accomodate it. Even so, the animation will still
|
||||
View that holds your animation will not automatically adjust to accommodate it. Even so, the animation will still
|
||||
be drawn beyond the bounds of its View and will not be clipped. However, clipping <em>will occur</em>
|
||||
if the animation exceeds the bounds of the parent View.</p>
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ like <code>drawBitmap(...)</code>, <code>drawRect(...)</code>, <code>drawText(..
|
||||
Other classes that you might use also have <code>draw()</code> methods. For example, you'll probably
|
||||
have some {@link android.graphics.drawable.Drawable} objects that you want to put on the Canvas. Drawable
|
||||
has its own <code>{@link android.graphics.drawable.Drawable#draw(Canvas) draw()}</code> method
|
||||
that takes your Canvas as an arguement.</p>
|
||||
that takes your Canvas as an argument.</p>
|
||||
|
||||
|
||||
<h3 id="on-view">On a View</h3>
|
||||
@@ -124,7 +124,7 @@ and drawing with a Canvas in <code>{@link android.view.View#onDraw(Canvas) View.
|
||||
The most convenient aspect of doing so is that the Android framework will
|
||||
provide you with a pre-defined Canvas to which you will place your drawing calls.</p>
|
||||
|
||||
<p>To start, extend the {@link android.view.View} class (or descendent thereof) and define
|
||||
<p>To start, extend the {@link android.view.View} class (or descendant thereof) and define
|
||||
the <code>{@link android.view.View#onDraw(Canvas) onDraw()}</code> callback method. This method will be called by the Android
|
||||
framework to request that your View draw itself. This is where you will perform all your calls
|
||||
to draw through the {@link android.graphics.Canvas}, which is passed to you through the <code>onDraw()</code> callback.</p>
|
||||
@@ -190,7 +190,7 @@ with <code>{@link android.graphics.Canvas#drawBitmap(Bitmap,Rect,RectF,Paint) dr
|
||||
you will see traces of the drawings you previously performed.</p>
|
||||
|
||||
|
||||
<p>For a sample application, see the Lunar Landar game, in the SDK samples folder:
|
||||
<p>For a sample application, see the Lunar Lander game, in the SDK samples folder:
|
||||
<code><your-sdk-directory>/samples/LunarLander/</code>. Or,
|
||||
browse the source in the <a href="{@docRoot}guide/samples/index.html">Sample Code</a> section.</p>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ page.title=<activity>
|
||||
android:<a href="#proc">process</a>="<i>string</i>"
|
||||
android:<a href="#screen">screenOrientation</a>=["unspecified" | "user" | "behind" |
|
||||
"landscape" | "portrait" |
|
||||
"sensor" | "nonsensor"]
|
||||
"sensor" | "nosensor"]
|
||||
android:<a href="#state">stateNotNeeded</a>=["true" | "false"]
|
||||
android:<a href="#aff">taskAffinity</a>="<i>string</i>"
|
||||
android:<a href="#theme">theme</a>="<i>resource or theme</i>"
|
||||
@@ -687,7 +687,7 @@ Values set here (other than "{@code stateUnspecified}" and
|
||||
keyboard. Rather, the contents of the window are automatically
|
||||
panned so that the current focus is never obscured by the keyboard
|
||||
and users can always see what they are typing. This is generally less
|
||||
desireable than resizing, because the user may need to close the soft
|
||||
desirable than resizing, because the user may need to close the soft
|
||||
keyboard to get at and interact with obscured parts of the window.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -28,7 +28,7 @@ attributes for each of its parts:
|
||||
These attributes are optional, but also mutually dependent:
|
||||
If a <code><a href="{@docRoot}guide/topics/manifest/data-element.html#scheme">scheme</a></code> is not specified for the
|
||||
intent filter, all the other URI attributes are ignored. If a
|
||||
<code><a href="{@docRoot}guide/topics/manifest/data-element.html#host">host</a></code> is not specified for the filer,
|
||||
<code><a href="{@docRoot}guide/topics/manifest/data-element.html#host">host</a></code> is not specified for the filter,
|
||||
the {@code port} attribute and all the path attributes are ignored.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ strings in the user interface.</dd>
|
||||
<dd>The name that's at the base of the permission tree. It serves as
|
||||
a prefix to all permission names in the tree. Java-style scoping should
|
||||
be used to ensure that the name is unique. The name must have more than
|
||||
two period-separated seqments in its path — for example,
|
||||
two period-separated segments in its path — for example,
|
||||
{@code com.example.base} is OK, but {@code com.example} is not.</dd>
|
||||
|
||||
</dl></dd>
|
||||
|
||||
@@ -185,7 +185,7 @@ processes, and "{@code false}" if not. The default value is "{@code false}".
|
||||
Normally, a content provider is instantiated in the process of the
|
||||
application that defined it. However, if this flag is set to "{@code true}",
|
||||
the system can create an instance in every process where there's a client
|
||||
that wants to interact withit, thus avoiding the overhead of interprocess
|
||||
that wants to interact with it, thus avoiding the overhead of interprocess
|
||||
communication.
|
||||
</p></dd>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ page.title=<receiver>
|
||||
<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code></dd>
|
||||
|
||||
<dt>can contain:</dt>
|
||||
<dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filer></a></code>
|
||||
<dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code>
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data></a></code></dd>
|
||||
|
||||
<dt>description:</dt>
|
||||
|
||||
@@ -17,7 +17,7 @@ page.title=<service>
|
||||
<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code></dd>
|
||||
|
||||
<dt>can contain:</dt>
|
||||
<dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filer></a></code>
|
||||
<dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code>
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data></a></code></dd>
|
||||
|
||||
<dt>description:</dt>
|
||||
|
||||
@@ -993,7 +993,7 @@ Both would be used together in an interactive game or application.</p>
|
||||
results, scoring or other game actions can take place. </li>
|
||||
<li><span
|
||||
lang=EN-IE>Musical transitions between levels or action sequences can be
|
||||
synchronized to be musically seemless.</li>
|
||||
synchronized to be musically seamless.</li>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
@@ -731,7 +731,7 @@ class name of the content provider (made lowercase). So, for example, the
|
||||
URI for a TransportationProvider class could be defined as follows:
|
||||
|
||||
<pre>public static final Uri CONTENT_URI =
|
||||
Uri.parse("content://com.example.codelab.transporationprovider");</pre>
|
||||
Uri.parse("content://com.example.codelab.transportationprovider");</pre>
|
||||
|
||||
<p>
|
||||
If the provider has subtables, also define {@code CONTENT_URI} constants for
|
||||
@@ -740,9 +740,9 @@ that identifies the content provider), and be distinguished only by their paths.
|
||||
For example:
|
||||
</p>
|
||||
|
||||
<p style="margin-left: 2em">{@code content://com.example.codelab.transporationprovider/train}
|
||||
<br/>{@code content://com.example.codelab.transporationprovider/air/domestic}
|
||||
<br/>{@code content://com.example.codelab.transporationprovider/air/international}</p>
|
||||
<p style="margin-left: 2em">{@code content://com.example.codelab.transportationprovider/train}
|
||||
<br/>{@code content://com.example.codelab.transportationprovider/air/domestic}
|
||||
<br/>{@code content://com.example.codelab.transportationprovider/air/international}</p>
|
||||
|
||||
<p>
|
||||
For an overview of {@code content:} URIs, see the <a href="#urisum">Content URI
|
||||
|
||||
@@ -224,7 +224,7 @@ tags.
|
||||
<p>
|
||||
The following declares two strings: the first — simple text with no
|
||||
formatting (resulting in a CharSequence that is simply a String object) — the second includes formatting information in the string (resulting
|
||||
in a CharSequence that is a complex data structure). If you are using the custom editor for string files in Eclipse, the HTML formatting tags will automatically be escaped and you will need to use {@link android.content.Context#getString(int) Context.getString()} and {@link android.text.Html#fromHtml} to retreive the resource and then convert it to formatted text.
|
||||
in a CharSequence that is a complex data structure). If you are using the custom editor for string files in Eclipse, the HTML formatting tags will automatically be escaped and you will need to use {@link android.content.Context#getString(int) Context.getString()} and {@link android.text.Html#fromHtml} to retrieve the resource and then convert it to formatted text.
|
||||
</p>
|
||||
<pre>
|
||||
<resources>
|
||||
|
||||
@@ -754,7 +754,7 @@ Android platform defines a "View" style class that
|
||||
contains all of the standard view attributes: padding, visibility,
|
||||
background, etc.; when View is inflated it uses this style class to
|
||||
retrieve those values from the XML file (at which point style and theme
|
||||
information is applied as approriate) and load them into its instance.</p>
|
||||
information is applied as appropriate) and load them into its instance.</p>
|
||||
|
||||
<p><strong>Configuration</strong>: For any particular resource identifier, there may be
|
||||
multiple different available values depending on the current configuration.
|
||||
|
||||
@@ -37,7 +37,7 @@ binds to data of some type. AdapterView is useful whenever you need to display s
|
||||
|
||||
<h2 id="FillingTheLayout">Filling the Layout with Data</h2>
|
||||
<p>Inserting data into the layout is typically done by binding the AdapterView class to an {@link
|
||||
android.widget.Adapter}, which retireves data from an external source (perhaps a list that
|
||||
android.widget.Adapter}, which retrieves data from an external source (perhaps a list that
|
||||
the code supplies or query results from the device's database). </p>
|
||||
<p>The following code sample does the following:</p>
|
||||
<ol>
|
||||
@@ -68,7 +68,7 @@ SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,
|
||||
android.R.layout.simple_spinner_item, // Use a template
|
||||
// that displays a
|
||||
// text view
|
||||
cur, // Give the cursor to the list adatper
|
||||
cur, // Give the cursor to the list adapter
|
||||
new String[] {People.NAME}, // Map the NAME column in the
|
||||
// people database to...
|
||||
new int[] {android.R.id.text1}); // The "text1" view defined in
|
||||
@@ -86,7 +86,7 @@ you should call {@link android.widget.ArrayAdapter#notifyDataSetChanged()}. This
|
||||
that the data has been changed and it should refresh itself.</p>
|
||||
|
||||
<h2 id="HandlingUserSelections">Handling User Selections</h2>
|
||||
<p>You handle the user's selecction by setting the class's {@link
|
||||
<p>You handle the user's selection by setting the class's {@link
|
||||
android.widget.AdapterView.OnItemClickListener} member to a listener and
|
||||
catching the selection changes. </p>
|
||||
<pre>
|
||||
|
||||
@@ -159,7 +159,7 @@ custom components, styled text, or anything else you can think of.</p>
|
||||
<p class="note"><strong>Note:</strong>
|
||||
This does not apply to 3D graphics. If you want to
|
||||
use 3D graphics, you must extend {@link android.view.SurfaceView SurfaceView}
|
||||
instead of View, and draw from a seperate thread. See the
|
||||
instead of View, and draw from a separate thread. See the
|
||||
GLSurfaceViewActivity sample
|
||||
for details.</p>
|
||||
|
||||
@@ -443,7 +443,7 @@ useful in certain circumstances. If there is a component that is already very
|
||||
similar to what you want, you can simply extend that component and just
|
||||
override the behavior that you want to change. You can do all of the things
|
||||
you would do with a fully customized component, but by starting with a more
|
||||
specialized class in the View heirarchy, you can also get a lot of behavior for
|
||||
specialized class in the View hierarchy, you can also get a lot of behavior for
|
||||
free that probably does exactly what you want.</p>
|
||||
<p>For example, the SDK includes a <a
|
||||
href="{@docRoot}guide/samples/NotePad/index.html">NotePad application</a> in the
|
||||
|
||||
@@ -115,7 +115,7 @@ public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
<p>The <code>onCreate()</code> callback method in your Activity is called by the Android framework when
|
||||
your Activity is launched (see the discussion on Lifecycles, in the
|
||||
<a href="{@docRoot}guide/topics/fundamentals.html#lcycles">Application Fundamantals</a>, for more on this).</p>
|
||||
<a href="{@docRoot}guide/topics/fundamentals.html#lcycles">Application Fundamentals</a>, for more on this).</p>
|
||||
|
||||
|
||||
<h2 id="attributes">Attributes</h2>
|
||||
|
||||
@@ -154,7 +154,7 @@ to the object and if the dialog is showing, it will dismiss it.</p>
|
||||
|
||||
<h3>Using dismiss listeners</h3>
|
||||
|
||||
<p>If you'd like your applcation to perform some procedures the moment that a dialog is dismissed,
|
||||
<p>If you'd like your application to perform some procedures the moment that a dialog is dismissed,
|
||||
then you should attach an on-dismiss listener to your Dialog.</p>
|
||||
|
||||
<p>First define the {@link android.content.DialogInterface.OnDismissListener} interface.
|
||||
|
||||
@@ -51,7 +51,7 @@ and each View is responsible for drawing itself.
|
||||
</p>
|
||||
|
||||
<div class="sidebox"><p>
|
||||
To intiate a layout, call <code>{@link android.view.View#requestLayout}</code>. This method is typically
|
||||
To initiate a layout, call <code>{@link android.view.View#requestLayout}</code>. This method is typically
|
||||
called by a View on itself when it believes that is can no longer fit within
|
||||
its current bounds.</p>
|
||||
</div>
|
||||
@@ -86,7 +86,7 @@ and each View is responsible for drawing itself.
|
||||
child. The child must use this size, and guarantee that all of its
|
||||
descendants will fit within this size.</li>
|
||||
<li><var>AT_MOST</var>: This is used by the parent to impose a maximum size on the
|
||||
child. The child must gurantee that it and all of its descendants will fit
|
||||
child. The child must guarantee that it and all of its descendants will fit
|
||||
within this size.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ and drawn, read <a href="how-android-draws.html">How Android Draws Views</a>.</p
|
||||
|
||||
<p>The most common way to define your layout and express the view hierarchy is with an XML layout file.
|
||||
XML offers a human-readable structure for the layout, much like HTML. Each element in XML is
|
||||
either a View or ViewGroup object (or descendent thereof). View objects are leaves in the tree,
|
||||
either a View or ViewGroup object (or descendant thereof). View objects are leaves in the tree,
|
||||
ViewGroup objects are branches in the tree (see the View Hierarchy figure above).</p>
|
||||
<p>The name of an XML element
|
||||
is respective to the Java class that it represents. So a <code><TextView></code> element creates
|
||||
|
||||
@@ -86,7 +86,7 @@ an icon, a keyboard shortcut, an intent, and other settings for the item.</p>
|
||||
Usually, you'll want to use one that accepts an <var>itemId</var> argument.
|
||||
This is a unique integer that allows you to identify the item during a callback.</p>
|
||||
|
||||
<p>When a menu item is selected from the Options Menu, you will recieve a callback to the
|
||||
<p>When a menu item is selected from the Options Menu, you will receive a callback to the
|
||||
<code>{@link android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()}</code>
|
||||
method of your Activity. This callback passes you the
|
||||
<code>MenuItem</code> that has been selected. You can identify the item by requesting the
|
||||
@@ -216,7 +216,7 @@ from the {@code MenuItem}, which provides information about the currently select
|
||||
All we need from
|
||||
this is the list ID for the selected item, so whether editing a note or deleting it,
|
||||
we find the ID with the {@code AdapterContextMenuInfo.info} field of the object. This ID
|
||||
is passed to the <code>editNote()</code> and <code>deleteNote()</code> methods to perfrom
|
||||
is passed to the <code>editNote()</code> and <code>deleteNote()</code> methods to perform
|
||||
the respective action.</p>
|
||||
|
||||
<p>Now, to register this context menu for all the items in a {@link android.widget.ListView},
|
||||
@@ -338,7 +338,7 @@ and set whether the items can be checkable with
|
||||
<img align="right" src="{@docRoot}images/radio_buttons.png" alt="" />
|
||||
<p>Any menu item can be used as an interface for turning options on and off. This can
|
||||
be indicated with a checkbox for stand-alone options, or radio buttons for groups of
|
||||
mutually exlusive options (see the screenshot, to the right).</p>
|
||||
mutually exclusive options (see the screenshot, to the right).</p>
|
||||
|
||||
<p class="note"><strong>Note:</strong> Menu items in the Icon Menu cannot
|
||||
display a checkbox or radio button. If you choose to make items in the Icon Menu checkable,
|
||||
@@ -490,7 +490,7 @@ public boolean onCreateOptionsMenu(Menu menu){
|
||||
null, // Specific items to place first (none)
|
||||
intent, // Intent created above that describes our requirements
|
||||
0, // Additional flags to control items (none)
|
||||
null); // Array of MenuItems that corrolate to specific items (none)
|
||||
null); // Array of MenuItems that correlate to specific items (none)
|
||||
|
||||
return true;
|
||||
}</pre>
|
||||
|
||||
@@ -25,7 +25,7 @@ and others do not. For example:</p>
|
||||
<li>When an event such as saving a file is complete, a small message
|
||||
should appear to confirm that the save was successful.</li>
|
||||
<li>If the application is running in the background and needs the user's attention,
|
||||
the application should create a notificaiton that allows the user to respond at
|
||||
the application should create a notification that allows the user to respond at
|
||||
his or her convenience.</li>
|
||||
<li>If the application is
|
||||
performing work that the user must wait for (such as loading a file),
|
||||
@@ -49,7 +49,7 @@ links to full documentation.</p>
|
||||
|
||||
<img src="{@docRoot}images/toast.png" alt="" style="float:right" />
|
||||
|
||||
<p>A toast notificaiton is a message that pops up on the surface of the window.
|
||||
<p>A toast notification is a message that pops up on the surface of the window.
|
||||
It only fills the amount of space required for the message and the user's current
|
||||
activity remains visible and interactive. The notification automatically fades in and
|
||||
out, and does not accept interaction events. Because a toast can be created from a background
|
||||
@@ -97,7 +97,7 @@ for notifications and short activities that directly relate to the application i
|
||||
|
||||
<p>You should use a dialog when you need to show a progress bar or a short
|
||||
message that requires confirmation from the user (such as an alert with "OK" and "Cancel" buttons).
|
||||
You can use also use dialogs as integral componenents
|
||||
You can use also use dialogs as integral components
|
||||
in your application's UI and for other purposes besides notifications.
|
||||
For a complete discussion on all the available types of dialogs,
|
||||
including its uses for notifications, refer to
|
||||
|
||||
@@ -316,7 +316,7 @@ using Notification fields and flags. Some useful features include the following:
|
||||
your notification is on-going.</dd>
|
||||
<dt><var>number</var> field</dt>
|
||||
<dd>This value indicates the current number of events represented by the notification.
|
||||
The appropriate number is overlayed on top of the status bar icon.
|
||||
The appropriate number is overlaid on top of the status bar icon.
|
||||
If you intend to use this field, then you must start with "1" when the Notification is first
|
||||
created. (If you change the value from zero to anything greater during an update, the number
|
||||
is not shown.)</dd>
|
||||
@@ -375,7 +375,7 @@ pass it to the <var>contentView</var> field of your Notification. Pass the
|
||||
</pre>
|
||||
|
||||
<p>This layout is used for the expanded view,
|
||||
but the content of the ImageView and TextView still needs to be defined by the applicaiton.
|
||||
but the content of the ImageView and TextView still needs to be defined by the application.
|
||||
RemoteViews offers some convenient methods that allow you to define this content...</p>
|
||||
</li>
|
||||
|
||||
@@ -389,7 +389,7 @@ contentView.setTextViewText(R.id.text, "Hello, this message is in a custom expan
|
||||
notification.contentView = contentView;
|
||||
</pre>
|
||||
|
||||
<p>As shown here, pass the applicaiton's package name and the layout
|
||||
<p>As shown here, pass the application's package name and the layout
|
||||
resource ID to the RemoteViews constructor. Then, define the content for the ImageView and TextView,
|
||||
using the {@link android.widget.RemoteViews#setImageViewResource(int, int) setImageViewResource()}
|
||||
and {@link android.widget.RemoteViews#setTextViewText(int, CharSequence) setTextViewText()}.
|
||||
|
||||
@@ -18,7 +18,7 @@ parent.link=index.html
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>A toast notificaiton is a message that pops up on the surface of the window.
|
||||
<p>A toast notification is a message that pops up on the surface of the window.
|
||||
It only fills the amount of space required for the message and the user's current
|
||||
activity remains visible and interactive. The notification automatically fades in and
|
||||
out, and does not accept interaction events.</p>
|
||||
|
||||
@@ -111,7 +111,7 @@ This technique can be used only in XML resources.
|
||||
</p>
|
||||
|
||||
<h3 id="inTheManifest">Set the theme in the manifest</h3>
|
||||
<p>To set this theme for all the activites of your application, open the AndroidManifest.xml file and
|
||||
<p>To set this theme for all the activities of your application, open the AndroidManifest.xml file and
|
||||
edit the <code><application></code> tag to include the <code>android:theme</code> attribute with the
|
||||
theme name:</p>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ methods that look useful for UI events. These methods are called by the Android
|
||||
respective action occurs on that object. For instance, when a View (such as a Button) is touched,
|
||||
the <code>onTouchEvent()</code> method is called on that object. However, in order to intercept this, you must extend
|
||||
the class and override the method. Obviously, extending every View object
|
||||
you want to use (just to handle an event) would be obsurd. This is why the View class also contains
|
||||
you want to use (just to handle an event) would be absurd. This is why the View class also contains
|
||||
a collection of nested interfaces with callbacks that you can much more easily define. These interfaces,
|
||||
called <a href="#EventListeners">event listeners</a>, are your ticket to capturing the user interaction with your UI.</p>
|
||||
|
||||
@@ -102,7 +102,7 @@ protected void onCreate(Bundle savedValues) {
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>You may also find it more conventient to implement OnClickListener as a part of your Activity.
|
||||
<p>You may also find it more convenient to implement OnClickListener as a part of your Activity.
|
||||
This will avoid the extra class load and object allocation. For example:</p>
|
||||
<pre>
|
||||
public class ExampleActivity extends Activity implements OnClickListener {
|
||||
@@ -139,7 +139,7 @@ depends on the event. For the few that do, here's why:</p>
|
||||
this event can have multiple actions that follow each other. So, if you return <em>false</em> when the
|
||||
down action event is received, you indicate that you have not consumed the event and are also
|
||||
not interested in subsequent actions from this event. Thus, you will not be called for any other actions
|
||||
within the event, such as a fingure gesture, or the eventual up action event.</li>
|
||||
within the event, such as a finger gesture, or the eventual up action event.</li>
|
||||
</ul>
|
||||
|
||||
<p>Remember that key events are always delivered to the View currently in focus. They are dispatched starting from the top
|
||||
@@ -168,7 +168,7 @@ you'll learn see some of the common callbacks used for event handling, including
|
||||
<li><code>{@link android.view.View#onTouchEvent}</code> - Called when a touch screen motion event occurs.</li>
|
||||
<li><code>{@link android.view.View#onFocusChanged}</code> - Called when the view gains or loses focus.</li>
|
||||
</ul>
|
||||
<p>There are some other methods that you should be awere of, which are not part of the View class,
|
||||
<p>There are some other methods that you should be aware of, which are not part of the View class,
|
||||
but can directly impact the way you're able to handle events. So, when managing more complex events inside
|
||||
a layout, consider these other methods:</p>
|
||||
<ul>
|
||||
|
||||
@@ -151,7 +151,7 @@ custom components, styled text, or anything else you can think of.</p>
|
||||
<p><em>Note:</em>
|
||||
Except for 3D graphics. If you want to
|
||||
use 3D graphics, you must extend {@link android.view.SurfaceView SurfaceView}
|
||||
instead of View, and draw from a seperate thread. See the
|
||||
instead of View, and draw from a separate thread. See the
|
||||
GLSurfaceViewActivity sample
|
||||
for details.</p>
|
||||
<p><code>onMeasure()</code> is a little more involved. <code>onMeasure()</code>
|
||||
@@ -171,7 +171,7 @@ result will be an exception at measurement time.</p>
|
||||
<li>
|
||||
The overridden <code>onMeasure()</code> method is called with width and
|
||||
height measure specifications (<code>widthMeasureSpec</code> and
|
||||
<code>heighMeasureSpec</code> parameters, both are integer codes
|
||||
<code>heightMeasureSpec</code> parameters, both are integer codes
|
||||
representing dimensions) which should be treated as requirements for
|
||||
the restrictions on the width and height measurements you should produce. A
|
||||
full reference to the kind of restrictions these specifications can require
|
||||
@@ -434,7 +434,7 @@ useful in certain circumstances. If there is a component that is already very
|
||||
similar to what you want, you can simply extend that component and just
|
||||
override the behavior that you want to change. You can do all of the things
|
||||
you would do with a fully customized component, but by starting with a more
|
||||
specialized class in the View heirarchy, you can also get a lot of behavior for
|
||||
specialized class in the View hierarchy, you can also get a lot of behavior for
|
||||
free that probably does exactly what you want.</p>
|
||||
<p>For example, the SDK includes a <a
|
||||
href="{@docRoot}samples/NotePad/index.html">NotePad application</a> in the
|
||||
|
||||
@@ -478,12 +478,12 @@ particularly powerful with the code-completion features of IDEs like Eclipse
|
||||
because it lets you quickly and interactively locate the specific reference
|
||||
you're looking for.</p>
|
||||
|
||||
<p>It's possible yours looks slighly different than this (perhaps the hexadecimal values are different).
|
||||
<p>It's possible yours looks slightly different than this (perhaps the hexadecimal values are different).
|
||||
For now, notice the inner class named "layout", and its
|
||||
member field "main". The Eclipse plugin noticed the XML
|
||||
layout file named main.xml and generated a class for it here. As you add other
|
||||
resources to your project (such as strings in the <code>res/values/string.xml</code> file or drawables inside
|
||||
the <code>res/drawable/</code> direcory) you'll see <code>R.java</code> change to keep up.</p>
|
||||
the <code>res/drawable/</code> directory) you'll see <code>R.java</code> change to keep up.</p>
|
||||
<p>When not using Eclipse, this class file will be generated for you at build time (with the Ant tool).</p>
|
||||
<p><em>You should never edit this file by hand.</em></p>
|
||||
</div>
|
||||
|
||||
@@ -44,7 +44,7 @@ protected void onCreate(Bundle savedInstanceState) {
|
||||
textView.setAdapter(adapter);
|
||||
}
|
||||
</pre>
|
||||
<p>Here, we create an AutoComplteteTextView from our layout. We then
|
||||
<p>Here, we create an AutoCompleteTextView from our layout. We then
|
||||
create an {@link android.widget.ArrayAdapter} that binds a <code>simple_dropdown_item_1line</code>
|
||||
layout item to each entry in the <code>COUNTRIES</code> array (which we'll add next).
|
||||
The last part sets the ArrayAdapter to associate with our AutoCompleteTextView.</p>
|
||||
|
||||
@@ -175,7 +175,7 @@ inside a {@link android.widget.RadioGroup}:
|
||||
</li>
|
||||
<li>To do something when each is selected, we'll need an OnClickListener. Unlike the other
|
||||
listeners we've created, instead of creating this one as an anonymous inner class,
|
||||
we'll create it as a new object. This way, we can re-use the OnClickLIstener for
|
||||
we'll create it as a new object. This way, we can re-use the OnClickListener for
|
||||
both RadioButtons. So, add the following code in the HelloFormStuff Activity
|
||||
(<em>outside</em> the <code>onCreate()</code> method):
|
||||
<pre>
|
||||
|
||||
@@ -94,7 +94,7 @@ public class ImageAdapter extends BaseAdapter {
|
||||
}
|
||||
</pre>
|
||||
<p>First we take care of some required methods inherited from BaseAdapter.
|
||||
The constructor and <code>getCount()</code> are self-explanitory. Normally, <code>getItem()</code>
|
||||
The constructor and <code>getCount()</code> are self-explanatory. Normally, <code>getItem()</code>
|
||||
should return the actual object at the specified position in our Adapter, but for this Hello World,
|
||||
we're not going to bother. Likewise, <code>getItemId()</code> should return the row id of
|
||||
the item, but right now we don't care.</p>
|
||||
|
||||
@@ -81,7 +81,7 @@ First, we'll create a simple Activity that can view and navigate a map. Then we
|
||||
|
||||
<li>Now open the HelloMapView.java file. For this Activity, we're going to extend the special sub-class of
|
||||
Activity called MapActivity, so change the class declaration to extend
|
||||
MapActicity, instead of Activity:</p>
|
||||
MapActivity, instead of Activity:</p>
|
||||
|
||||
<pre>public class HelloMapView extends MapActivity {</pre>
|
||||
|
||||
@@ -134,7 +134,7 @@ mZoom = (ZoomControls) mapView.getZoomControls();</pre>
|
||||
<p>By using the ZoomControls object provided by MapView, we don't have to do any of the work
|
||||
required to actually perform the zoom operations. The ZoomControls widget that MapView
|
||||
returns for us is already hooked into the MapView and works as soon as we add it to the
|
||||
layout. The controls will appear whenever the user touches the map, then dissapear after
|
||||
layout. The controls will appear whenever the user touches the map, then disappear after
|
||||
a few moments of inactivity.</p></li>
|
||||
|
||||
<li>Now just plug our ZoomControls into the LinearLayout we added:
|
||||
|
||||
@@ -53,7 +53,7 @@ tabs to navigate between different views.</p>
|
||||
be associated with a different tab.
|
||||
In this case, each tab simply shows a different {@link android.widget.TextView} with some text. </p>
|
||||
<p>Notice that the TabWidget and the FrameLayout elements have specific <code>android</code> namespace IDs. These are necessary
|
||||
so that the TabHost can automatically retireve references to them, populate the TabWidget with the tabs that we'll define
|
||||
so that the TabHost can automatically retrieve references to them, populate the TabWidget with the tabs that we'll define
|
||||
in our code, and swap the views in the FrameLayout. We've also defined our own IDs for each TextView, which we'll use to
|
||||
associate each tab with the view that it should reveal.</p>
|
||||
<p>Of course, you can
|
||||
|
||||
@@ -95,7 +95,7 @@ the tools included in the SDK (skip to <a href="#next">Next Steps</a>).</p>
|
||||
<p>Android offers a custom plugin for the Eclipse IDE, called Android
|
||||
Development Tools (ADT), that is designed to give you a powerful,
|
||||
integrated environment in which to build Android applications. It
|
||||
extends the capabilites of Eclipse to let you quickly set up new Android
|
||||
extends the capabilities of Eclipse to let you quickly set up new Android
|
||||
projects, create an application UI, add components based on the Android
|
||||
Framework API, debug your applications using the Android SDK tools, and even export
|
||||
signed (or unsigned) APKs in order to distribute your application.</p>
|
||||
@@ -125,7 +125,7 @@ and click <strong>Next</strong>. </li>
|
||||
<li>In the resulting dialog box, enter a name for the remote site (e.g. "Android Plugin") and
|
||||
enter the URL:
|
||||
<pre>https://dl-ssl.google.com/android/eclipse/</pre>
|
||||
<p>If you have trouble aqcuiring the plugin, try using "http" in the URL,
|
||||
<p>If you have trouble acquiring the plugin, try using "http" in the URL,
|
||||
instead of "https" (https is preferred for security reasons).</p>
|
||||
<p>Click <strong>OK</strong>.</p> </li>
|
||||
<li>You should now see the new site added to the search list (and checked).
|
||||
@@ -151,7 +151,7 @@ and click <strong>Next</strong>. </li>
|
||||
<li>Click <strong>Add Site...</strong> </li>
|
||||
<li>Enter the Location:
|
||||
<pre>https://dl-ssl.google.com/android/eclipse/</pre>
|
||||
<p>If you have trouble aqcuiring the plugin, try using "http" in the Location URL,
|
||||
<p>If you have trouble acquiring the plugin, try using "http" in the Location URL,
|
||||
instead of "https" (https is preferred for security reasons).</p>
|
||||
<p>Click <strong>OK</strong>.</p></li>
|
||||
<li>Back in the Available Software view, you should see the plugin listed by the URL,
|
||||
@@ -217,7 +217,7 @@ follow these steps again instead of the default update instructions.</p>
|
||||
|
||||
<p>Note that there are features of ADT that require some optional
|
||||
Eclipse components (for example, WST). If you encounter an error when
|
||||
installing ADT, your Eclipse installion might not include these components.
|
||||
installing ADT, your Eclipse installation might not include these components.
|
||||
For information about how to quickly add the necessary components to your
|
||||
Eclipse installation, see the troubleshooting topic
|
||||
<a href="{@docRoot}guide/appendix/faq/troubleshooting.html#installeclipsecomponents">ADT
|
||||
@@ -271,7 +271,7 @@ begin developing applications. Here are a few ways you can get started: </p>
|
||||
<li>Follow the <a href="{@docRoot}guide/tutorials/notepad/index.html">
|
||||
Notepad Tutorial</a> to build a full Android application </li>
|
||||
<li>Create a new project for one of the other sample applications
|
||||
included in <code><em><sdk></em>/platforms/<em><platfrom></em>/samples</code>,
|
||||
included in <code><em><sdk></em>/platforms/<em><platform></em>/samples</code>,
|
||||
then compile and run it in your development environment</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ uninstall procedure and continue to <a href="#installAdt">Install the 0.9 ADT pl
|
||||
<ol>
|
||||
<li>Select <strong>Help</strong> > <strong>Software Updates</strong>.</li>
|
||||
<li>Select the <strong>Available Software</strong> tab.</li>
|
||||
<li>Expand the entry for the Andriod plugin (may be listed as the location URL)
|
||||
<li>Expand the entry for the Android plugin (may be listed as the location URL)
|
||||
and select "Developer Tools" by checking the box next to it, then click
|
||||
<strong>Install</strong>.</li>
|
||||
<li>On the next window, "Android DDMS" and "Android Development Tools"
|
||||
@@ -272,7 +272,7 @@ first target ("1"), which uses the Android 1.1 platform library.</p>
|
||||
your AIDL Java files will be generated in here. You <strong>must</strong> remove
|
||||
the old <code>R.java</code> and old auto-generated AIDL java files from the
|
||||
<code>src/</code> folder. (This
|
||||
does not apply to your own hand-crafted parcelabe AIDL java files.)</p>
|
||||
does not apply to your own hand-crafted parcelable AIDL java files.)</p>
|
||||
|
||||
<p class="note"><strong>Note:</strong> The "activitycreator" tool has been replaced
|
||||
by the new "android" tool. For information on creating new projects with the android tool,
|
||||
@@ -368,7 +368,7 @@ if it performs any of the following:</p>
|
||||
listens for special keypress events that only occur on a keypad, then your application
|
||||
should degrade gracefully when there is no keyboard available.
|
||||
</li>
|
||||
<li>Performs its own layout orientation changes based on the acceletometer (or via other
|
||||
<li>Performs its own layout orientation changes based on the accelerometer (or via other
|
||||
sensors). Some devices running Android 1.5 will automatically rotate the orientation
|
||||
(and all devices have the option to turn on auto-rotation), so if your application also
|
||||
attempts to rotate the orientation, it can result in strange behavior. In addition, if your
|
||||
|
||||
@@ -96,7 +96,7 @@ changes include: </p>
|
||||
<ul>
|
||||
<li>Multiple versions of the Android platform are included (Android 1.1,
|
||||
Android 1.5). The tools are updated to let you deploy your application
|
||||
on any platform in the SDK, which helps you ensure forward-compitility and,
|
||||
on any platform in the SDK, which helps you ensure forward-compatibility and,
|
||||
if applicable, backward-compatibility.</li>
|
||||
<li>Introduces <a href="{@docRoot}guide/developing/tools/avd.html">Android
|
||||
Virtual Devices</a> — (AVD) configurations of options that you
|
||||
@@ -107,7 +107,7 @@ that are running concurrently.</li>
|
||||
Android SDK to give you access to one or more external Android libraries and/or
|
||||
a customized (but compliant) system image that can run in the emulator. </li>
|
||||
<li>The new Eclipse ADT plugin (version 0.9.x) offers new Wizards to let you
|
||||
create projects targetted for specific Android configurations, generate XML
|
||||
create projects targeted for specific Android configurations, generate XML
|
||||
resources (such as layouts, animations, and menus), generate alternate layouts,
|
||||
and export and sign your application for publishing.</li>
|
||||
<li>Improved JUnit support in ADT</li>
|
||||
@@ -442,9 +442,9 @@ SDK</a>.
|
||||
|
||||
<h3>Other Notes</h3>
|
||||
|
||||
<p><strong>T-Mobile G1 Compatability</strong></p>
|
||||
<p><strong>T-Mobile G1 Compatibility</strong></p>
|
||||
|
||||
<p>This version of the SDK has been tested for compatability with the first
|
||||
<p>This version of the SDK has been tested for compatibility with the first
|
||||
Android-powered mobile device, the <a href="http://www.t-mobileg1.com">T-Mobile
|
||||
G1</a>. </p>
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ new APIs introduced since Android 1.0, you can remove the attribute or
|
||||
set it to "1". However,
|
||||
before publishing your application, you must make sure to compile your
|
||||
application against the Android library that corresponds to the application's
|
||||
<code>android:minSdkVeresion</code> value.</p>
|
||||
<code>android:minSdkVersion</code> value.</p>
|
||||
|
||||
<h2 id="apps">Built-in Applications</h2>
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ Applications</a>.</p>
|
||||
|
||||
<p>The sections below describe the system and software requirements for using
|
||||
the Android NDK, as well as platform compatibility considerations that affect
|
||||
appplications using libraries produced with the NDK. </p>
|
||||
applications using libraries produced with the NDK. </p>
|
||||
|
||||
<h4>The Android SDK</h4>
|
||||
<ul>
|
||||
|
||||
@@ -98,7 +98,7 @@ function renderPlaylist(data) {
|
||||
// Check whether this playlist includes the video title inside the description meta-data, so we can remove it
|
||||
if (playlistsWithTitleInDescription.indexOf(playlistId) != -1) {
|
||||
var lines = fullDescription.split("\n");
|
||||
// If the first line includes the first 17 chars from the title, let's use the title from the desciption instead (because it's a more complete title)
|
||||
// If the first line includes the first 17 chars from the title, let's use the title from the description instead (because it's a more complete title)
|
||||
// This accounts for, literally, "Google I/O 2009 -", which is (so far) the min AND max for properly identifying a title in the only playlist with titles in the description
|
||||
if (lines[0].indexOf(title.slice(0,16)) != -1) {
|
||||
h3Title = "<h3>" + lines[0] + "</h3>";
|
||||
@@ -332,7 +332,7 @@ function clickDefaultVideo() {
|
||||
<script type="text/javascript">
|
||||
// Initialization actions
|
||||
showFeatured(); // load featured videos
|
||||
showPlaylists(); // load playslists
|
||||
showPlaylists(); // load playlists
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user