docs: InfoPros Project 02 - Batch 02 updates
b/26490262 Change-Id: I3838f0c96ed687684457d2c56044148f56a29f8d
This commit is contained in:
@@ -988,8 +988,7 @@ data-cardsizes="6x3,6x3,6x3,6x3,6x3,6x3" data-maxresults="6">
|
||||
Switch to another app to send the test app into the background. Go to
|
||||
Settings and check whether the test app has any services running while in
|
||||
the background. In Android 4.0 and higher, go to the Apps screen and find
|
||||
the app in the "Running" tab. In earlier versions, use "Manage
|
||||
Applications" to check for running services.
|
||||
the app in the "Running" tab.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
9
docs/html/training/basics/firstapp/running-app.jd
Normal file → Executable file
9
docs/html/training/basics/firstapp/running-app.jd
Normal file → Executable file
@@ -54,17 +54,12 @@ line tools.</p>
|
||||
If you're developing on Windows, you might need to install the appropriate USB driver for your
|
||||
device. For help installing drivers, see the <a href="{@docRoot}tools/extras/oem-usb.html">OEM
|
||||
USB Drivers</a> document.</li>
|
||||
<li>Enable <strong>USB debugging</strong> on your device.
|
||||
<ul>
|
||||
<li>On most devices running Android 3.2 or older, you can find the option under
|
||||
<strong>Settings > Applications > Development</strong>.</li>
|
||||
<li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>.
|
||||
<li>Enable <strong>USB debugging</strong> on your device. On Android 4.0 and newer, go to
|
||||
<strong>Settings > Developer options</strong>.
|
||||
<p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer
|
||||
options</strong> is hidden by default. To make it available, go
|
||||
to <strong>Settings > About phone</strong> and tap <strong>Build number</strong>
|
||||
seven times. Return to the previous screen to find <strong>Developer options</strong>.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
|
||||
7
docs/html/training/basics/fragments/creating.jd
Normal file → Executable file
7
docs/html/training/basics/fragments/creating.jd
Normal file → Executable file
@@ -38,13 +38,6 @@ extend the {@link android.support.v4.app.Fragment} class using the <a
|
||||
href="{@docRoot}tools/support-library/index.html">Support Library</a> so your app
|
||||
remains compatible with devices running system versions as low as Android 1.6.</p>
|
||||
|
||||
<p class="note"><strong>Note:</strong> If you decide that the minimum
|
||||
API level your app requires is 11 or higher, you don't need to use the Support
|
||||
Library and can instead use the framework's built in {@link android.app.Fragment} class and related
|
||||
APIs. Just be aware that this lesson is focused on using the APIs from the Support Library, which
|
||||
use a specific package signature and sometimes slightly different API names than the versions
|
||||
included in the platform.</p>
|
||||
|
||||
<p>Before you begin this lesson, you must set up your Android project to use the Support Library.
|
||||
If you have not used the Support Library before, set up your project to use the <strong>v4</strong>
|
||||
library by following the <a href="{@docRoot}tools/support-library/setup.html">Support Library
|
||||
|
||||
4
docs/html/training/basics/intents/result.jd
Normal file → Executable file
4
docs/html/training/basics/intents/result.jd
Normal file → Executable file
@@ -107,8 +107,8 @@ contact the user selected.</p>
|
||||
<p>In order to successfully handle the result, you must understand what the format of the result
|
||||
{@link android.content.Intent} will be. Doing so is easy when the activity returning a result is
|
||||
one of your own activities. Apps included with the Android platform offer their own APIs that
|
||||
you can count on for specific result data. For instance, the People app (Contacts app on some older
|
||||
versions) always returns a result with the content URI that identifies the selected contact, and the
|
||||
you can count on for specific result data. For instance, the People app always returns a result
|
||||
with the content URI that identifies the selected contact, and the
|
||||
Camera app returns a {@link android.graphics.Bitmap} in the {@code "data"} extra (see the class
|
||||
about <a href="{@docRoot}training/camera/index.html">Capturing Photos</a>).</p>
|
||||
|
||||
|
||||
4
docs/html/training/custom-views/making-interactive.jd
Normal file → Executable file
4
docs/html/training/custom-views/making-interactive.jd
Normal file → Executable file
@@ -229,8 +229,8 @@ if (!mScroller.isFinished()) {
|
||||
is not available prior to API level 11, so this technique cannot be used
|
||||
on devices running Android versions lower than 3.0.</p>
|
||||
|
||||
<p class="note"><strong>Note:</strong> {@link android.animation.ValueAnimator} isn't available
|
||||
prior to API level 11, but you can still use it in applications that
|
||||
<p class="note"><strong>Note:</strong> You can use {@link android.animation.ValueAnimator} in
|
||||
applications that
|
||||
target lower API levels. You just need to make sure to check the current API level
|
||||
at runtime, and omit the calls to the view animation system if the current level is less than 11.</p>
|
||||
|
||||
|
||||
45
docs/html/training/game-controllers/compatibility.jd
Normal file → Executable file
45
docs/html/training/game-controllers/compatibility.jd
Normal file → Executable file
@@ -13,7 +13,7 @@ trainingnavtop=true
|
||||
Suppport</a></li>
|
||||
<li><a href="#abstraction">Add an Interface for Backward Compatibility</a></li>
|
||||
<li><a href="#newer">Implement the Interface on Android 4.1 and Higher</a></li>
|
||||
<li><a href="#older">Implement the Interface on Android 2.3 up to Android
|
||||
<li><a href="#older">Implement the Interface on Android 3.1 up to Android
|
||||
4.0</a></li>
|
||||
<li><a href="#using">Use the Version-Specific Implementations</a></li>
|
||||
</ol>
|
||||
@@ -36,7 +36,7 @@ their controllers even when they switch or upgrade their Android devices.</p>
|
||||
|
||||
<p>This lesson demonstrates how to use APIs available in Android 4.1 and higher
|
||||
in a backward compatible way, enabling your game to support the following
|
||||
features on devices running Android 2.3 and higher:</p>
|
||||
features on devices running Android 3.1 and higher:</p>
|
||||
<ul>
|
||||
<li>The game can detect if a new game controller is added, changed, or removed.</li>
|
||||
<li>The game can query the capabilities of a game controller.</li>
|
||||
@@ -48,20 +48,20 @@ provided by the sample {@code ControllerSample.zip} available for download
|
||||
above. This sample shows how to implement the {@code InputManagerCompat}
|
||||
interface to support different versions of Android. To compile the sample, you
|
||||
must use Android 4.1 (API level 16) or higher. Once compiled, the sample app
|
||||
runs on any device running Android 2.3 (API level 9) or higher as the build
|
||||
runs on any device running Android 3.1 (API level 12) or higher as the build
|
||||
target.
|
||||
</p>
|
||||
|
||||
<h2 id="prepare">Prepare to Abstract APIs for Game Controller Support</h2>
|
||||
<p>Suppose you want to be able to determine if a game controller's connection
|
||||
status has changed on devices running on Android 2.3 (API level 9). However,
|
||||
status has changed on devices running on Android 3.1 (API level 12). However,
|
||||
the APIs are only available in Android 4.1 (API level 16) and higher, so you
|
||||
need to provide an implementation that supports Android 4.1 and higher while
|
||||
providing a fallback mechanism that supports Android 2.3 up to Android 4.0.</p>
|
||||
providing a fallback mechanism that supports Android 3.1 up to Android 4.0.</p>
|
||||
|
||||
<p>To help you determine which features require such a fallback mechanism for
|
||||
older versions, table 1 lists the differences in game controller support
|
||||
between Android 2.3 (API level 9), 3.1 (API level 12), and 4.1 (API level
|
||||
between Android 3.1 (API level 12) and 4.1 (API level
|
||||
16).</p>
|
||||
|
||||
<p class="table-caption" id="game-controller-support-table">
|
||||
@@ -74,7 +74,6 @@ different Android versions.
|
||||
<tr>
|
||||
<th>Controller Information</th>
|
||||
<th>Controller API</th>
|
||||
<th>API level 9</th>
|
||||
<th>API level 12</th>
|
||||
<th>API level 16</th>
|
||||
</tr>
|
||||
@@ -83,34 +82,29 @@ different Android versions.
|
||||
<td rowspan="5">Device Identification</td>
|
||||
<td>{@link android.hardware.input.InputManager#getInputDeviceIds()}</td>
|
||||
<td style="text-align: center;"><big> </big></td>
|
||||
<td style="text-align: center;"><big> </big></td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{@link android.hardware.input.InputManager#getInputDevice(int)
|
||||
getInputDevice()}</td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"><big> </big></td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{@link android.view.InputDevice#getVibrator()}</td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"><big> </big></td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
|
||||
<td>{@link android.view.InputDevice#SOURCE_JOYSTICK}</td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{@link android.view.InputDevice#SOURCE_GAMEPAD}</td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
@@ -119,21 +113,18 @@ getInputDevice()}</td>
|
||||
<td rowspan="3">Connection Status</td>
|
||||
<td>{@link android.hardware.input.InputManager.InputDeviceListener#onInputDeviceAdded(int) onInputDeviceAdded()}</td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{@link android.hardware.input.InputManager.InputDeviceListener#onInputDeviceChanged(int) onInputDeviceChanged()}</td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{@link android.hardware.input.InputManager.InputDeviceListener#onInputDeviceRemoved(int) onInputDeviceRemoved()}</td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
|
||||
@@ -147,7 +138,6 @@ getInputDevice()}</td>
|
||||
{@link android.view.KeyEvent#KEYCODE_DPAD_CENTER})</td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -162,7 +152,6 @@ getInputDevice()}</td>
|
||||
{@link android.view.KeyEvent#KEYCODE_BUTTON_L1 BUTTON_L1},
|
||||
{@link android.view.KeyEvent#KEYCODE_BUTTON_R2 BUTTON_R2},
|
||||
{@link android.view.KeyEvent#KEYCODE_BUTTON_L2 BUTTON_L2})</td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
@@ -175,7 +164,6 @@ getInputDevice()}</td>
|
||||
{@link android.view.MotionEvent#AXIS_RZ},
|
||||
{@link android.view.MotionEvent#AXIS_HAT_X},
|
||||
{@link android.view.MotionEvent#AXIS_HAT_Y})</td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
@@ -184,7 +172,6 @@ getInputDevice()}</td>
|
||||
<td>Analog trigger press (
|
||||
{@link android.view.MotionEvent#AXIS_LTRIGGER},
|
||||
{@link android.view.MotionEvent#AXIS_RTRIGGER})</td>
|
||||
<td style="text-align: center;"> </td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
<td style="text-align: center;"><big>•</big></td>
|
||||
</tr>
|
||||
@@ -200,7 +187,7 @@ the game controller features required by your game.</li>
|
||||
<li>Create a proxy implementation of your interface that uses APIs in Android
|
||||
4.1 and higher.</li>
|
||||
<li>Create a custom implementation of your interface that uses APIs available
|
||||
between Android 2.3 up to Android 4.0.</li>
|
||||
between Android 3.1 up to Android 4.0.</li>
|
||||
<li>Create the logic for switching between these implementations at runtime,
|
||||
and begin using the interface in your game.</li>
|
||||
</ol>
|
||||
@@ -284,8 +271,9 @@ removed.</dd>
|
||||
across different platform versions. If your game is running on Android 4.1 or
|
||||
higher and calls an {@code InputManagerCompat} method, the proxy implementation
|
||||
calls the equivalent method in {@link android.hardware.input.InputManager}.
|
||||
However, if your game is running on Android 2.3 up to Android 4.0, the custom implementation processes calls to {@code InputManagerCompat} methods by using
|
||||
only APIs introduced no later than Android 2.3. Regardless of which
|
||||
However, if your game is running on Android 3.1 up to Android 4.0, the custom implementation
|
||||
processes calls to {@code InputManagerCompat} methods by using
|
||||
only APIs introduced no later than Android 3.1. Regardless of which
|
||||
version-specific implementation is used at runtime, the implementation passes
|
||||
the call results back transparently to the game.</p>
|
||||
|
||||
@@ -377,11 +365,10 @@ public class InputManagerV16 implements InputManagerCompat {
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2 id="older">Implementing the Interface on Android 2.3 up to Android 4.0</h2>
|
||||
<h2 id="older">Implementing the Interface on Android 3.1 up to Android 4.0</h2>
|
||||
|
||||
<p>The {@code InputManagerV9} implementation uses APIs introduced no later
|
||||
than Android 2.3. To create an implementation of {@code
|
||||
InputManagerCompat} that supports Android 2.3 up to Android 4.0, you can use
|
||||
<p>To create an implementation of {@code
|
||||
InputManagerCompat} that supports Android 3.1 up to Android 4.0, you can use
|
||||
the following objects:
|
||||
<ul>
|
||||
<li>A {@link android.util.SparseArray} of device IDs to track the
|
||||
@@ -586,7 +573,7 @@ private static class DeviceEvent implements Runnable {
|
||||
|
||||
<p>You now have two implementations of {@code InputManagerCompat}: one that
|
||||
works on devices running Android 4.1 and higher, and another
|
||||
that works on devices running Android 2.3 up to Android 4.0.</p>
|
||||
that works on devices running Android 3.1 up to Android 4.0.</p>
|
||||
|
||||
<h2 id="using">Use the Version-Specific Implementation</h2>
|
||||
<p>The version-specific switching logic is implemented in a class that acts as
|
||||
@@ -626,7 +613,7 @@ public class GameView extends View implements InputDeviceListener {
|
||||
onGenericMotionEvent()} method in your main view, as described in
|
||||
<a href="controller-input.html#analog">Handle a MotionEvent from a Game
|
||||
Controller</a>. Your game should now be able to process game controller events
|
||||
consistently on devices running Android 2.3 (API level 9) and higher.
|
||||
consistently on devices running Android 3.1 (API level 12) and higher.
|
||||
<p>
|
||||
<pre>
|
||||
@Override
|
||||
@@ -640,4 +627,4 @@ public boolean onGenericMotionEvent(MotionEvent event) {
|
||||
</pre>
|
||||
<p>You can find a complete implementation of this compatibility code in the
|
||||
{@code GameView} class provided in the sample {@code ControllerSample.zip}
|
||||
available for download above.</p>
|
||||
available for download above.</p>
|
||||
|
||||
5
docs/html/training/multiscreen/screensizes.jd
Normal file → Executable file
5
docs/html/training/multiscreen/screensizes.jd
Normal file → Executable file
@@ -56,9 +56,8 @@ next.link=screendensities.html
|
||||
you should use <code>"wrap_content"</code> and <code>"match_parent"</code> for the width
|
||||
and height of some view components. If you use <code>"wrap_content"</code>, the width
|
||||
or height of the view is set to the minimum size necessary to fit the content
|
||||
within that view, while <code>"match_parent"</code> (also known as
|
||||
<code>"fill_parent"</code> before API level 8) makes the component expand to match the size of its
|
||||
parent view.</p>
|
||||
within that view, while <code>"match_parent"</code> makes the component expand to match the size of
|
||||
its parent view.</p>
|
||||
|
||||
<p>By using the <code>"wrap_content"</code> and <code>"match_parent"</code> size values instead of
|
||||
hard-coded sizes, your views either use only the space required for that
|
||||
|
||||
2
docs/html/training/system-ui/dim.jd
Normal file → Executable file
2
docs/html/training/system-ui/dim.jd
Normal file → Executable file
@@ -53,7 +53,7 @@ creating an immersive experience without sacrificing easy access to the bars.</p
|
||||
|
||||
<h2 id="dim">Dim the Status and Navigation Bars</h2>
|
||||
|
||||
<p>You can dim the status and notification bars on Android 4.0 and higher using the
|
||||
<p>You can dim the status and notification bars using the
|
||||
{@link android.view.View#SYSTEM_UI_FLAG_LOW_PROFILE} flag, as follows:</p>
|
||||
|
||||
<pre>
|
||||
|
||||
6
docs/html/training/system-ui/navigation.jd
Normal file → Executable file
6
docs/html/training/system-ui/navigation.jd
Normal file → Executable file
@@ -10,7 +10,7 @@ trainingnavtop=true
|
||||
<!-- table of contents -->
|
||||
<h2>This lesson teaches you to</h2>
|
||||
<ol>
|
||||
<li><a href="#40">Hide the Navigation Bar on 4.0 and Higher</a></li>
|
||||
<li><a href="#40">Hide the Navigation Bar</a></li>
|
||||
<li><a href="#behind">Make Content Appear Behind the Navigation Bar</a></li>
|
||||
</ol>
|
||||
|
||||
@@ -56,9 +56,9 @@ user experience. </p>
|
||||
|
||||
|
||||
|
||||
<h2 id="40">Hide the Navigation Bar on 4.0 and Higher</h2>
|
||||
<h2 id="40">Hide the Navigation Bar</h2>
|
||||
|
||||
<p>You can hide the navigation bar on Android 4.0 and higher using the
|
||||
<p>You can hide the navigation bar using the
|
||||
{@link android.view.View#SYSTEM_UI_FLAG_HIDE_NAVIGATION} flag. This snippet hides both
|
||||
the navigation bar and the status bar:</p>
|
||||
<pre>View decorView = getWindow().getDecorView();
|
||||
|
||||
2
docs/html/training/system-ui/status.jd
Normal file → Executable file
2
docs/html/training/system-ui/status.jd
Normal file → Executable file
@@ -12,8 +12,6 @@ trainingnavtop=true
|
||||
<ol>
|
||||
<li><a href="#40">Hide the Status Bar on Android 4.0 and Lower</a></li>
|
||||
<li><a href="#41">Hide the Status Bar on Android 4.1 and Higher</a></li>
|
||||
<li><a href="#44">Hide the Status Bar on Android 4.4 and Higher</a></li>
|
||||
|
||||
<li><a href="#behind">Make Content Appear Behind the Status Bar</a></li>
|
||||
<li><a href="#action-bar">Synchronize the Status Bar with Action Bar Transition</a></li>
|
||||
</ol>
|
||||
|
||||
Reference in New Issue
Block a user