summaryrefslogtreecommitdiffstats
path: root/docs/html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html')
-rw-r--r--docs/html/distribute/googleplay/edu/faq.jd8
-rw-r--r--docs/html/distribute/googleplay/edu/guidelines.jd6
-rw-r--r--docs/html/distribute/googleplay/edu/start.jd15
-rw-r--r--docs/html/google/play-services/setup.jd2
-rw-r--r--docs/html/guide/components/fundamentals.jd388
-rw-r--r--docs/html/guide/components/index.jd2
-rw-r--r--docs/html/guide/guide_toc.cs267
-rw-r--r--docs/html/guide/index.jd75
-rw-r--r--docs/html/guide/practices/compatibility.jd485
-rw-r--r--docs/html/guide/practices/screens_support.jd3
-rw-r--r--docs/html/guide/topics/connectivity/nfc/hce.jd569
-rw-r--r--docs/html/guide/topics/manifest/manifest-intro.jd2
-rw-r--r--docs/html/guide/topics/security/permissions.jd72
-rw-r--r--docs/html/training/best-ui.jd11
-rw-r--r--docs/html/training/best-ux.jd13
-rw-r--r--docs/html/training/system-ui/navigation.jd3
-rw-r--r--docs/html/training/training_toc.cs63
17 files changed, 1075 insertions, 909 deletions
diff --git a/docs/html/distribute/googleplay/edu/faq.jd b/docs/html/distribute/googleplay/edu/faq.jd
index 6afc107..0c3b185 100644
--- a/docs/html/distribute/googleplay/edu/faq.jd
+++ b/docs/html/distribute/googleplay/edu/faq.jd
@@ -258,7 +258,7 @@ excludeFromSuggestions=true
</dt>
<dd>
- If you’d like to reach users of Nexus tablets for schools we encourage you
+ If you’d like to reach tablet users in schools we encourage you
to build a native app for the optimal user experience. Considerations for
building your app and instructions for registering it can be found at
<a href="http://developer.android.com/edu">developer.android.com/edu</a>.
@@ -325,9 +325,9 @@ excludeFromSuggestions=true
</dt>
<dd>
- Nexus 7 is available for shipment now, and the Asus Transformer will be
- available in early 2014. We look forward to welcoming more Android devices
- into the Google in Education family soon.
+ Nexus 7 is available for shipment now, and the Asus Transformer and HP
+ Slate 8 Pro will be available in early 2014. We look forward to welcoming
+ more Android devices into the Google in Education family soon.
</dd>
<dt>
diff --git a/docs/html/distribute/googleplay/edu/guidelines.jd b/docs/html/distribute/googleplay/edu/guidelines.jd
index c4b719b..8427044 100644
--- a/docs/html/distribute/googleplay/edu/guidelines.jd
+++ b/docs/html/distribute/googleplay/edu/guidelines.jd
@@ -208,11 +208,11 @@ Google Play for Education.</p>
<h3 id="devices">Android tablets</h3>
-<p>Google Play for Education uses primarily Nexus 7 devices, so
-your testing can focus on that specific hardware device. You can purchase the
+<p>Google Play for Education offers a range of 7-inch through 10-inch tablets, so
+your testing should focus on those hardware devices. You can purchase the Nexus 7
device from <a href="https://play.google.com/store/devices/details?id=nexus_7_16gb"
target="_android">Google Play</a> and other stores. Although testing on Nexus
-devices is preferred, you can test on other 7-inch (or 10-inch) tablets or virtual
+devices is preferred, you can test on other 7-inch or 10-inch tablets or virtual
devices if you don't have access to Nexus devices.</p>
<h3 id="conditions">Test conditions</h3>
diff --git a/docs/html/distribute/googleplay/edu/start.jd b/docs/html/distribute/googleplay/edu/start.jd
index 01d4406..dbfbb6a 100644
--- a/docs/html/distribute/googleplay/edu/start.jd
+++ b/docs/html/distribute/googleplay/edu/start.jd
@@ -84,11 +84,16 @@ tablets &mdash; a good starting point is the <a
href="{@docRoot}distribute/googleplay/quality/tablet.html">Tablet App Quality
Guidelines</a>. </p>
-<p>Throughout design and development, it's important to have a suitable device
-on which to prototype and test your user experience. It's highly recommended
-that you acquire one or more tablet devices and set up your testing environment
-as early as possible. The recommended hardware device that replicates the Google
-Play for Education environment is the Nexus 7, which is available from <a href="https://play.google.com/store/devices/details?id=nexus_7_16gb" target="_android">Google Play</a> and other stores.</p>
+<p>
+ Throughout design and development, it's important to have suitable devices
+ on which to prototype and test your user experience. It's highly recommended
+ that you acquire 7-inch and 10-inch tablet devices and set up
+ your testing environment as early as possible. The recommended 7-inch
+ hardware device that replicates the Google Play for Education environment is
+ the Nexus 7, which is available from <a href=
+ "https://play.google.com/store/devices/details?id=nexus_7_16gb" target=
+ "_android">Google Play</a> and other stores.
+</p>
<p>Proper testing and quality assurance are key aspects of delivering a great
app for teachers and students. Make sure you set up a <a
diff --git a/docs/html/google/play-services/setup.jd b/docs/html/google/play-services/setup.jd
index 5c8c63b..4db1178 100644
--- a/docs/html/google/play-services/setup.jd
+++ b/docs/html/google/play-services/setup.jd
@@ -169,7 +169,7 @@ required classes, add the following lines in the
-keepnames &#64;com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
- &#64;ccom.google.android.gms.common.annotation.KeepName *;
+ &#64;com.google.android.gms.common.annotation.KeepName *;
}
-keepnames class * implements android.os.Parcelable {
diff --git a/docs/html/guide/components/fundamentals.jd b/docs/html/guide/components/fundamentals.jd
index ce50022..9ac063e 100644
--- a/docs/html/guide/components/fundamentals.jd
+++ b/docs/html/guide/components/fundamentals.jd
@@ -4,24 +4,9 @@ page.title=Application Fundamentals
<div id="qv-wrapper">
<div id="qv">
-<h2>Quickview</h2>
-<ul>
- <li>Android applications are composed of one or more application components (activities,
-services, content providers, and broadcast receivers)</li>
- <li>Each component performs a different role in the overall application behavior, and each
-one can be activated individually (even by other applications)</li>
- <li>The manifest file must declare all components in the application and should also declare
-all application requirements, such as the minimum version of Android required and any hardware
-configurations required</li>
- <li>Non-code application resources (images, strings, layout files, etc.) should include
-alternatives for different device configurations (such as different strings for different
-languages and different layouts for different screen sizes)</li>
-</ul>
-
-
<h2>In this document</h2>
<ol>
-<li><a href="#Components">Application Components</a>
+<li><a href="#Components">App Components</a>
<ol>
<li><a href="#ActivatingComponents">Activating components</a></li>
</ol>
@@ -29,98 +14,91 @@ languages and different layouts for different screen sizes)</li>
<li><a href="#Manifest">The Manifest File</a>
<ol>
<li><a href="#DeclaringComponents">Declaring components</a></li>
- <li><a href="#DeclaringRequirements">Declaring application requirements</a></li>
+ <li><a href="#DeclaringRequirements">Declaring app requirements</a></li>
</ol>
</li>
-<li><a href="#Resources">Application Resources</a></li>
+<li><a href="#Resources">App Resources</a></li>
</ol>
</div>
</div>
-<p>Android applications are written in the Java programming language. The Android SDK tools compile
-the code&mdash;along with any data and resource files&mdash;into an <i>Android package</i>, an
-archive file with an {@code .apk} suffix. All the code in a single {@code .apk} file is considered
-to be one application and is the file that Android-powered devices use to install the
-application.</p>
+<p>Android apps are written in the Java programming language. The Android SDK tools compile
+your code&mdash;along with any data and resource files&mdash;into an APK: an <i>Android package</i>,
+which is an archive file with an {@code .apk} suffix. One APK file contains all the contents
+of an Android app and is the file that Android-powered devices use to install the app.</p>
-<p>Once installed on a device, each Android application lives in its own security sandbox: </p>
+<p>Once installed on a device, each Android app lives in its own security sandbox: </p>
<ul>
- <li>The Android operating system is a multi-user Linux system in which each application is a
+ <li>The Android operating system is a multi-user Linux system in which each app is a
different user.</li>
-<li>By default, the system assigns each application a unique Linux user ID (the ID is used only by
-the system and is unknown to the application). The system sets permissions for all the files in an
-application so that only the user ID assigned to that application can access them. </li>
+<li>By default, the system assigns each app a unique Linux user ID (the ID is used only by
+the system and is unknown to the app). The system sets permissions for all the files in an
+app so that only the user ID assigned to that app can access them. </li>
-<li>Each process has its own virtual machine (VM), so an application's code runs in isolation from
-other applications.</li>
+<li>Each process has its own virtual machine (VM), so an app's code runs in isolation from
+other apps.</li>
-<li>By default, every application runs in its own Linux process. Android starts the process when any
-of the application's components need to be executed, then shuts down the process when it's no longer
-needed or when the system must recover memory for other applications.</li>
+<li>By default, every app runs in its own Linux process. Android starts the process when any
+of the app's components need to be executed, then shuts down the process when it's no longer
+needed or when the system must recover memory for other apps.</li>
</ul>
<p>In this way, the Android system implements the <em>principle of least privilege</em>. That is,
-each application, by default, has access only to the components that it requires to do its work and
-no more. This creates a very secure environment in which an application cannot access parts of
+each app, by default, has access only to the components that it requires to do its work and
+no more. This creates a very secure environment in which an app cannot access parts of
the system for which it is not given permission.</p>
-<p>However, there are ways for an application to share data with other applications and for an
-application to access system services:</p>
+<p>However, there are ways for an app to share data with other apps and for an
+app to access system services:</p>
<ul>
- <li>It's possible to arrange for two applications to share the same Linux user ID, in which case
-they are able to access each other's files. To conserve system resources, applications with the
+ <li>It's possible to arrange for two apps to share the same Linux user ID, in which case
+they are able to access each other's files. To conserve system resources, apps with the
same user ID can also arrange to run in the same Linux process and share the same VM (the
-applications must also be signed with the same certificate).</li>
- <li>An application can request permission to access device data such as the user's
+apps must also be signed with the same certificate).</li>
+ <li>An app can request permission to access device data such as the user's
contacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. All
-application permissions must be granted by the user at install time.</li>
+app permissions must be granted by the user at install time.</li>
</ul>
-<p>That covers the basics regarding how an Android application exists within the system. The rest of
+<p>That covers the basics regarding how an Android app exists within the system. The rest of
this document introduces you to:</p>
<ul>
- <li>The core framework components that define your application.</li>
+ <li>The core framework components that define your app.</li>
<li>The manifest file in which you declare components and required device features for your
-application.</li>
- <li>Resources that are separate from the application code and allow your application to
+app.</li>
+ <li>Resources that are separate from the app code and allow your app to
gracefully optimize its behavior for a variety of device configurations.</li>
</ul>
-<!--
-<p class="note"><strong>Tip:</strong> If you're new to Android development, we suggest that you
-follow the Beginner's Path link at the bottom of this page. For each document in the Application
-Fundamentals, the Beginner's Path points you to the document we suggest you read next, in order
-to get up to speed on the core Android concepts.</p>
--->
-<h2 id="Components">Application Components</h2>
+<h2 id="Components">App Components</h2>
-<p>Application components are the essential building blocks of an Android application. Each
-component is a different point through which the system can enter your application. Not all
+<p>App components are the essential building blocks of an Android app. Each
+component is a different point through which the system can enter your app. Not all
components are actual entry points for the user and some depend on each other, but each one exists
as its own entity and plays a specific role&mdash;each one is a unique building block that
-helps define your application's overall behavior.</p>
+helps define your app's overall behavior.</p>
-<p>There are four different types of application components. Each type serves a distinct purpose
+<p>There are four different types of app components. Each type serves a distinct purpose
and has a distinct lifecycle that defines how the component is created and destroyed.</p>
-<p>Here are the four types of application components:</p>
+<p>Here are the four types of app components:</p>
<dl>
<dt><b>Activities</b></dt>
<dd>An <i>activity</i> represents a single screen with a user interface. For example,
-an email application might have one activity that shows a list of new
+an email app might have one activity that shows a list of new
emails, another activity to compose an email, and another activity for reading emails. Although
-the activities work together to form a cohesive user experience in the email application, each one
-is independent of the others. As such, a different application can start any one of these
-activities (if the email application allows it). For example, a camera application can start the
-activity in the email application that composes new mail, in order for the user to share a picture.
+the activities work together to form a cohesive user experience in the email app, each one
+is independent of the others. As such, a different app can start any one of these
+activities (if the email app allows it). For example, a camera app can start the
+activity in the email app that composes new mail, in order for the user to share a picture.
<p>An activity is implemented as a subclass of {@link android.app.Activity} and you can learn more
about it in the <a href="{@docRoot}guide/components/activities.html">Activities</a>
@@ -133,7 +111,7 @@ developer guide.</p>
<dd>A <i>service</i> is a component that runs in the background to perform long-running
operations or to perform work for remote processes. A service
does not provide a user interface. For example, a service might play music in the background while
-the user is in a different application, or it might fetch data over the network without
+the user is in a different app, or it might fetch data over the network without
blocking user interaction with an activity. Another component, such as an activity, can start the
service and let it run or bind to it in order to interact with it.
@@ -145,21 +123,21 @@ guide.</p>
<dt><b>Content providers</b></dt>
-<dd>A <i>content provider</i> manages a shared set of application data. You can store the data in
+<dd>A <i>content provider</i> manages a shared set of app data. You can store the data in
the file system, an SQLite database, on the web, or any other persistent storage location your
-application can access. Through the content provider, other applications can query or even modify
+app can access. Through the content provider, other apps can query or even modify
the data (if the content provider allows it). For example, the Android system provides a content
-provider that manages the user's contact information. As such, any application with the proper
+provider that manages the user's contact information. As such, any app with the proper
permissions can query part of the content provider (such as {@link
android.provider.ContactsContract.Data}) to read and write information about a particular person.
<p>Content providers are also useful for reading and writing data that is private to your
-application and not shared. For example, the <a
-href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a> sample application uses a
+app and not shared. For example, the <a
+href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a> sample app uses a
content provider to save notes.</p>
<p>A content provider is implemented as a subclass of {@link android.content.ContentProvider}
-and must implement a standard set of APIs that enable other applications to perform
+and must implement a standard set of APIs that enable other apps to perform
transactions. For more information, see the <a
href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> developer
guide.</p>
@@ -171,7 +149,7 @@ guide.</p>
<dd>A <i>broadcast receiver</i> is a component that responds to system-wide broadcast
announcements. Many broadcasts originate from the system&mdash;for example, a broadcast announcing
that the screen has turned off, the battery is low, or a picture was captured.
-Applications can also initiate broadcasts&mdash;for example, to let other applications know that
+Apps can also initiate broadcasts&mdash;for example, to let other apps know that
some data has been downloaded to the device and is available for them to use. Although broadcast
receivers don't display a user interface, they may <a
href="{@docRoot}guide/topics/ui/notifiers/notifications.html">create a status bar notification</a>
@@ -188,26 +166,26 @@ see the {@link android.content.BroadcastReceiver} class.</p>
-<p>A unique aspect of the Android system design is that any application can start another
-application’s component. For example, if you want the user to capture a
-photo with the device camera, there's probably another application that does that and your
-application can use it, instead of developing an activity to capture a photo yourself. You don't
-need to incorporate or even link to the code from the camera application.
-Instead, you can simply start the activity in the camera application that captures a
-photo. When complete, the photo is even returned to your application so you can use it. To the user,
-it seems as if the camera is actually a part of your application.</p>
+<p>A unique aspect of the Android system design is that any app can start another
+app’s component. For example, if you want the user to capture a
+photo with the device camera, there's probably another app that does that and your
+app can use it, instead of developing an activity to capture a photo yourself. You don't
+need to incorporate or even link to the code from the camera app.
+Instead, you can simply start the activity in the camera app that captures a
+photo. When complete, the photo is even returned to your app so you can use it. To the user,
+it seems as if the camera is actually a part of your app.</p>
-<p>When the system starts a component, it starts the process for that application (if it's not
+<p>When the system starts a component, it starts the process for that app (if it's not
already running) and instantiates the classes needed for the component. For example, if your
-application starts the activity in the camera application that captures a photo, that activity
-runs in the process that belongs to the camera application, not in your application's process.
-Therefore, unlike applications on most other systems, Android applications don't have a single entry
+app starts the activity in the camera app that captures a photo, that activity
+runs in the process that belongs to the camera app, not in your app's process.
+Therefore, unlike apps on most other systems, Android apps don't have a single entry
point (there's no {@code main()} function, for example).</p>
-<p>Because the system runs each application in a separate process with file permissions that
-restrict access to other applications, your application cannot directly activate a component from
-another application. The Android system, however, can. So, to activate a component in
-another application, you must deliver a message to the system that specifies your <em>intent</em> to
+<p>Because the system runs each app in a separate process with file permissions that
+restrict access to other apps, your app cannot directly activate a component from
+another app. The Android system, however, can. So, to activate a component in
+another app, you must deliver a message to the system that specifies your <em>intent</em> to
start a particular component. The system then activates the component for you.</p>
@@ -217,7 +195,7 @@ start a particular component. The system then activates the component for you.</
broadcast receivers&mdash;are activated by an asynchronous message called an <em>intent</em>.
Intents bind individual components to each other at runtime (you can think of them
as the messengers that request an action from other components), whether the component belongs
-to your application or another.</p>
+to your app or another.</p>
<p>An intent is created with an {@link android.content.Intent} object, which defines a message to
activate either a specific component or a specific <em>type</em> of component&mdash;an intent
@@ -273,21 +251,21 @@ href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers
<h2 id="Manifest">The Manifest File</h2>
-<p>Before the Android system can start an application component, the system must know that the
-component exists by reading the application's {@code AndroidManifest.xml} file (the "manifest"
-file). Your application must declare all its components in this file, which must be at the root of
-the application project directory.</p>
+<p>Before the Android system can start an app component, the system must know that the
+component exists by reading the app's {@code AndroidManifest.xml} file (the "manifest"
+file). Your app must declare all its components in this file, which must be at the root of
+the app project directory.</p>
-<p>The manifest does a number of things in addition to declaring the application's components,
+<p>The manifest does a number of things in addition to declaring the app's components,
such as:</p>
<ul>
- <li>Identify any user permissions the application requires, such as Internet access or
+ <li>Identify any user permissions the app requires, such as Internet access or
read-access to the user's contacts.</li>
<li>Declare the minimum <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Level</a>
-required by the application, based on which APIs the application uses.</li>
- <li>Declare hardware and software features used or required by the application, such as a camera,
+required by the app, based on which APIs the app uses.</li>
+ <li>Declare hardware and software features used or required by the app, such as a camera,
bluetooth services, or a multitouch screen.</li>
- <li>API libraries the application needs to be linked against (other than the Android framework
+ <li>API libraries the app needs to be linked against (other than the Android framework
APIs), such as the <a
href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps
library</a>.</li>
@@ -297,7 +275,7 @@ library</a>.</li>
<h3 id="DeclaringComponents">Declaring components</h3>
-<p>The primary task of the manifest is to inform the system about the application's components. For
+<p>The primary task of the manifest is to inform the system about the app's components. For
example, a manifest file can declare an activity as follows: </p>
<pre>
@@ -314,7 +292,7 @@ example, a manifest file can declare an activity as follows: </p>
<p>In the <code><a
href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
element, the {@code android:icon} attribute points to resources for an icon that identifies the
-application.</p>
+app.</p>
<p>In the <code><a
href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code> element,
@@ -322,7 +300,7 @@ the {@code android:name} attribute specifies the fully qualified class name of t
android.app.Activity} subclass and the {@code android:label} attributes specifies a string
to use as the user-visible label for the activity.</p>
-<p>You must declare all application components this way:</p>
+<p>You must declare all app components this way:</p>
<ul>
<li><code><a
href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code> elements
@@ -345,7 +323,7 @@ receivers can be either declared in the manifest or created dynamically in code
{@link android.content.BroadcastReceiver} objects) and registered with the system by calling
{@link android.content.Context#registerReceiver registerReceiver()}.</p>
-<p>For more about how to structure the manifest file for your application, see <a
+<p>For more about how to structure the manifest file for your app, see <a
href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a>
documentation. </p>
@@ -356,28 +334,43 @@ documentation. </p>
<p>As discussed above, in <a href="#ActivatingComponents">Activating Components</a>, you can use an
{@link android.content.Intent} to start activities, services, and broadcast receivers. You can do so
by explicitly naming the target component (using the component class name) in the intent. However,
-the real power of intents lies in the concept of intent actions. With intent actions, you simply
-describe the type of action you want to perform (and optionally, the data upon which you’d like to
+the real power of intents lies in the concept of <em>implicit intents</em>. An implicit intent
+simply describe the type of action to perform (and optionally, the data upon which you’d like to
perform the action) and allow the system to find a component on the device that can perform the
action and start it. If there are multiple components that can perform the action described by the
intent, then the user selects which one to use.</p>
<p>The way the system identifies the components that can respond to an intent is by comparing the
-intent received to the <i>intent filters</i> provided in the manifest file of other applications on
+intent received to the <i>intent filters</i> provided in the manifest file of other apps on
the device.</p>
-<p>When you declare a component in your application's manifest, you can optionally include
-intent filters that declare the capabilities of the component so it can respond to intents
-from other applications. You can declare an intent filter for your component by
+<p>When you declare an activity in your app's manifest, you can optionally include
+intent filters that declare the capabilities of the activity so it can respond to intents
+from other apps. You can declare an intent filter for your component by
adding an <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">{@code
&lt;intent-filter&gt;}</a> element as a child of the component's declaration element.</p>
-<p>For example, an email application with an activity for composing a new email might declare an
-intent filter in its manifest entry to respond to "send" intents (in order to send email). An
-activity in your application can then create an intent with the “send” action ({@link
-android.content.Intent#ACTION_SEND}), which the system matches to the email application’s “send”
-activity and launches it when you invoke the intent with {@link android.app.Activity#startActivity
-startActivity()}.</p>
+<p>For example, if you've built an email app with an activity for composing a new email, you can
+declare an intent filter to respond to "send" intents (in order to send a new email) like this:</p>
+<pre>
+&lt;manifest ... >
+ ...
+ &lt;application ... &gt;
+ &lt;activity android:name="com.example.project.ComposeEmailActivity">
+ &lt;intent-filter>
+ &lt;action android:name="android.intent.action.SEND" />
+ &lt;data android:type="*/*" />
+ &lt;category android:name="android.intent.category.DEFAULT" />
+ &lt;/intent-filter>
+ &lt;/activity>
+ &lt;/application&gt;
+&lt;/manifest>
+</pre>
+
+<p>Then, if another app creates an intent with the {@link
+android.content.Intent#ACTION_SEND} action and pass it to {@link android.app.Activity#startActivity
+startActivity()}, the system may start your activity so the user can draft and send an
+email.</p>
<p>For more about creating intent filters, see the <a
href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a> document.
@@ -385,102 +378,57 @@ href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filter
-<h3 id="DeclaringRequirements">Declaring application requirements</h3>
+<h3 id="DeclaringRequirements">Declaring app requirements</h3>
<p>There are a variety of devices powered by Android and not all of them provide the
-same features and capabilities. In order to prevent your application from being installed on devices
-that lack features needed by your application, it's important that you clearly define a profile for
-the types of devices your application supports by declaring device and software requirements in your
+same features and capabilities. In order to prevent your app from being installed on devices
+that lack features needed by your app, it's important that you clearly define a profile for
+the types of devices your app supports by declaring device and software requirements in your
manifest file. Most of these declarations are informational only and the system does not read
them, but external services such as Google Play do read them in order to provide filtering
-for users when they search for applications from their device.</p>
-
-<p>For example, if your application requires a camera and uses APIs introduced in Android 2.1 (<a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Level</a> 7), you should declare these as
-requirements in your manifest file. That way, devices that do <em>not</em> have a camera and have an
-Android version <em>lower</em> than 2.1 cannot install your application from Google Play.</p>
+for users when they search for apps from their device.</p>
-<p>However, you can also declare that your application uses the camera, but does not
-<em>require</em> it. In that case, your application must perform a check at runtime to determine
-if the device has a camera and disable any features that use the camera if one is not available.</p>
+<p>For example, if your app requires a camera and uses APIs introduced in Android 2.1 (<a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Level</a> 7),
+you should declare these as requirements in your manifest file like this:</p>
-<p>Here are some of the important device characteristics that you should consider as you design and
-develop your application:</p>
-
-<dl>
- <dt>Screen size and density</dt>
- <dd>In order to categorize devices by their screen type, Android defines two characteristics for
-each device: screen size (the physical dimensions of the screen) and screen density (the physical
-density of the pixels on the screen, or dpi&mdash;dots per inch). To simplify all the different
-types of screen configurations, the Android system generalizes them into select groups that make
-them easier to target.
-<p>The screen sizes are: small, normal, large, and extra large.<br/>
-The screen densities are: low density, medium density, high density, and extra high density.</p>
-
-<p>By default, your application is compatible with all screen sizes and densities,
-because the Android system makes the appropriate adjustments to your UI layout and image
-resources. However, you should create specialized layouts for certain screen sizes and provide
-specialized images for certain densities, using alternative layout resources, and by declaring in
-your manifest exactly which screen sizes your application supports with the <a
-href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
-&lt;supports-screens&gt;}</a> element.</p>
-<p>For more information, see the <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>
-document.</p></dd>
-
- <dt>Input configurations</dt>
- <dd>Many devices provide a different type of user input mechanism, such as a hardware keyboard, a
-trackball, or a five-way navigation pad. If your application requires a particular kind of input
-hardware, then you should declare it in your manifest with the <a
-href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">{@code
-&lt;uses-configuration&gt;}</a> element. However, it is rare that an application should require
-a certain input configuration.</dd>
-
- <dt>Device features</dt>
- <dd>There are many hardware and software features that may or may not exist on a given
-Android-powered device, such as a camera, a light sensor, bluetooth, a certain
-version of OpenGL, or the fidelity of the touchscreen. You should never assume that a certain
-feature is available on all Android-powered devices (other than the availability of the standard
-Android library), so you should declare any features used by your application with the <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature&gt;}</a>
-element.</dd>
-
- <dt>Platform Version</dt>
- <dd>Different Android-powered devices often run different versions of the Android platform,
-such as Android 1.6 or Android 2.3. Each successive version often includes additional APIs not
-available in the previous version. In order to indicate which set of APIs are available, each
-platform version specifies an <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Level</a> (for example, Android 1.0 is API Level
-1 and Android 2.3 is API Level 9). If you use any APIs that were added to the platform after
-version 1.0, you should declare the minimum API Level in which those APIs were introduced using the
-<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code &lt;uses-sdk&gt;}</a>
-element.</dd>
-</dl>
-
-<p>It's important that you declare all such requirements for your application, because, when you
-distribute your application on Google Play, the store uses these declarations to filter which
-applications are available on each device. As such, your application should be available only to
-devices that meet all your application requirements.</p>
-
-<p>For more information about how Google Play filters applications based on these (and other)
-requirements, see the <a href="{@docRoot}google/play/filters.html">Filters on Google Play</a>
+<pre>
+&lt;manifest ... >
+ &lt;uses-feature android:name="android.hardware.camera.any"
+ android:required="true" />
+ &lt;uses-sdk android:minSdkVersion="7" android:targetSdkVersion="19" />
+ ...
+&lt;/manifest>
+</pre>
+
+<p>Now, devices that do <em>not</em> have a camera and have an
+Android version <em>lower</em> than 2.1 cannot install your app from Google Play.</p>
+
+<p>However, you can also declare that your app uses the camera, but does not
+<em>require</em> it. In that case, your app must set the <a href=
+"{@docRoot}guide/topics/manifest/uses-feature-element.html#required">{@code required}</a>
+attribute to {@code "false"} and check at runtime whether
+the device has a camera and disable any camera features as appropriate.</p>
+
+<p>More information about how you can manage your app's compatibility with different devices
+is provided in the <a href="{@docRoot}guide/practices/compatibility.html">Device Compatibility</a>
document.</p>
-<h2 id="Resources">Application Resources</h2>
+<h2 id="Resources">App Resources</h2>
-<p>An Android application is composed of more than just code&mdash;it requires resources that are
+<p>An Android app is composed of more than just code&mdash;it requires resources that are
separate from the source code, such as images, audio files, and anything relating to the visual
-presentation of the application. For example, you should define animations, menus, styles, colors,
-and the layout of activity user interfaces with XML files. Using application resources makes it easy
-to update various characteristics of your application without modifying code and&mdash;by providing
-sets of alternative resources&mdash;enables you to optimize your application for a variety of
+presentation of the app. For example, you should define animations, menus, styles, colors,
+and the layout of activity user interfaces with XML files. Using app resources makes it easy
+to update various characteristics of your app without modifying code and&mdash;by providing
+sets of alternative resources&mdash;enables you to optimize your app for a variety of
device configurations (such as different languages and screen sizes).</p>
<p>For every resource that you include in your Android project, the SDK build tools define a unique
-integer ID, which you can use to reference the resource from your application code or from
-other resources defined in XML. For example, if your application contains an image file named {@code
+integer ID, which you can use to reference the resource from your app code or from
+other resources defined in XML. For example, if your app contains an image file named {@code
logo.png} (saved in the {@code res/drawable/} directory), the SDK tools generate a resource ID
named {@code R.drawable.logo}, which you can use to reference the image and insert it in your
user interface.</p>
@@ -504,15 +452,45 @@ depending on the orientation, you can define two different layouts and apply the
qualifier to each layout's directory name. Then, the system automatically applies the appropriate
layout depending on the current device orientation.</p>
-<p>For more about the different kinds of resources you can include in your application and how
-to create alternative resources for various device configurations, see the <a
-href="{@docRoot}guide/topics/resources/index.html">Application Resources</a> developer guide.</p>
-
-
-<!--
-<h2>Beginner's Path</h2>
+<p>For more about the different kinds of resources you can include in your application and how to
+create alternative resources for different device configurations, read <a href=
+"{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a>.</p>
+
+
+
+<div class="next-docs">
+<div class="col-6">
+ <h2 class="norule">Continue reading about:</h2>
+ <dl>
+ <dt><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
+ </dt>
+ <dd>Information about how to use the {@link android.content.Intent} APIs to
+ activate app components, such as activities and services, and how to make your app components
+ available for use by other apps.</dd>
+ <dt><a href="{@docRoot}guide/components/activities.html">Activities</a></dt>
+ <dd>Information about how to create an instance of the {@link android.app.Activity} class,
+ which provides a distinct screen in your application with a user interface.</dd>
+ <dt><a
+href="{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a></dt>
+ <dd>Information about how Android apps are structured to separate app resources from the
+ app code, including how you can provide alternative resources for specific device
+ configurations.
+ </dd>
+ </dl>
+</div>
+<div class="col-6">
+ <h2 class="norule">You might also be interested in:</h2>
+ <dl>
+ <dt><a href="{@docRoot}guide/practices/compatibility.html"
+ >Device Compatibility</a></dt>
+ <dd>Information about Android works on different types of devices and an introduction
+ to how you can optimize your app for each device or restrict your app's availability
+ to different devices.</dd>
+ <dt><a href="{@docRoot}guide/topics/security/permissions.html"
+ >System Permissions</a></dt>
+ <dd>Information about how Android restricts app access to certain APIs with a permission
+ system that requires the user's consent for your app to use those APIs.</dd>
+ </dl>
+</div>
+</div>
-<p>For a close look at implementing activities&mdash;the components your users use to
-interact with your application&mdash;continue with the <b><a
-href="{@docRoot}guide/components/activities.html">Activities</a></b> document.</p>
--->
diff --git a/docs/html/guide/components/index.jd b/docs/html/guide/components/index.jd
index 87bae53..37fb7e9 100644
--- a/docs/html/guide/components/index.jd
+++ b/docs/html/guide/components/index.jd
@@ -1,6 +1,6 @@
page.title=App Components
page.landing=true
-page.landing.intro=Android's application framework lets you create extremely rich and innovative apps using a set of reusable components. This section explains how Android apps work and how you use components to build them.
+page.landing.intro=Android's application framework lets you create rich and innovative apps using a set of reusable components. This section explains how you can build the components that define the building blocks of your app and how to connect them together using intents.
page.landing.image=images/develop/app_components.png
@jd:body
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 6a2b1ba..18b234e 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -6,17 +6,41 @@
localized titles are added in the language order specified below.
?>
<ul id="nav">
- <!-- Walkthrough for Developers -- quick overview of what it's like to develop on Android -->
- <!--<li style="color:red">Overview</li> -->
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/components/index.html">
- <span class="en">App Components</span>
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/index.html">
+ <span class="en">Introduction</span>
</a></div>
<ul>
<li><a href="<?cs var:toroot ?>guide/components/fundamentals.html">
<span class="en">App Fundamentals</span></a>
</li>
+ <li><a href="<?cs var:toroot ?>guide/practices/compatibility.html">
+ <span class="en">Device Compatibility</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/security/permissions.html">
+ <span class="en">System Permissions</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/components/index.html">
+ <span class="en">App Components</span>
+ </a></div>
+ <ul>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/components/intents-filters.html">
+ <span class="en">Intents and Intent Filters</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/components/intents-common.html">
+ <span class="en">Common Intents</span>
+ </a></li>
+ </ul>
+ </li>
<li class="nav-section">
<div class="nav-section-header"><a href="<?cs var:toroot ?>guide/components/activities.html">
<span class="en">Activities</span>
@@ -69,24 +93,6 @@
</ul>
</li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/components/intents-filters.html">
- <span class="en">Intents and Intent Filters</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/components/intents-common.html">
- <span class="en">Common Intents</span>
- </a></li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>guide/components/processes-and-threads.html">
- <span class="en">Processes and Threads</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>guide/topics/security/permissions.html">
- <span class="en">Permissions</span>
- </a>
- </li>
- <li class="nav-section">
<div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/appwidgets/index.html">
<span class="en">App Widgets</span>
</a></div>
@@ -96,42 +102,89 @@
</a></li>
</ul>
</li>
+ <li><a href="<?cs var:toroot ?>guide/components/processes-and-threads.html">
+ <span class="en">Processes and Threads</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/resources/index.html">
+ <span class="en">App Resources</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/overview.html">
+ <span class="en">Overview</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/providing-resources.html">
+ <span class="en">Providing Resources</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/accessing-resources.html">
+ <span class="en">Accessing Resources</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/runtime-changes.html">
+ <span class="en">Handling Runtime Changes</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/localization.html">
+ <span class="en">Localization</span>
+ </a></li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/manifest/manifest-intro.html">
- <span class="en">Android Manifest</span>
- </a></div>
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/resources/available-resources.html">
+ <span class="en">Resource Types</span>
+ </a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/action-element.html">&lt;action&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/activity-alias-element.html">&lt;activity-alias&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/application-element.html">&lt;application&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/category-element.html">&lt;category&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/compatible-screens-element.html">&lt;compatible-screens&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/data-element.html">&lt;data&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/grant-uri-permission-element.html">&lt;grant-uri-permission&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/instrumentation-element.html">&lt;instrumentation&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/meta-data-element.html">&lt;meta-data&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/path-permission-element.html">&lt;path-permission&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/permission-group-element.html">&lt;permission-group&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/permission-tree-element.html">&lt;permission-tree&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/receiver-element.html">&lt;receiver&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/service-element.html">&lt;service&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-gl-texture-element.html">&lt;supports-gl-texture&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-screens-element.html">&lt;supports-screens&gt;</a></li><!-- ##api level 4## -->
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-feature-element.html">&lt;uses-feature&gt;</a></li> <!-- ##api level 4## -->
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-library-element.html">&lt;uses-library&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/animation-resource.html">Animation</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/color-list-resource.html">Color State List</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/drawable-resource.html">Drawable</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/layout-resource.html">Layout</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/menu-resource.html">Menu</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/string-resource.html">String</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/style-resource.html">Style</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/more-resources.html">More Types</a></li>
</ul>
- </li><!-- end of the manifest file -->
+ </li><!-- end of resource types -->
+ </ul>
+ </li><!-- end of app resources -->
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/manifest/manifest-intro.html">
+ <span class="en">App Manifest</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/action-element.html">&lt;action&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/activity-alias-element.html">&lt;activity-alias&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/application-element.html">&lt;application&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/category-element.html">&lt;category&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/compatible-screens-element.html">&lt;compatible-screens&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/data-element.html">&lt;data&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/grant-uri-permission-element.html">&lt;grant-uri-permission&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/instrumentation-element.html">&lt;instrumentation&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/meta-data-element.html">&lt;meta-data&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/path-permission-element.html">&lt;path-permission&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/permission-group-element.html">&lt;permission-group&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/permission-tree-element.html">&lt;permission-tree&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/receiver-element.html">&lt;receiver&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/service-element.html">&lt;service&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-gl-texture-element.html">&lt;supports-gl-texture&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-screens-element.html">&lt;supports-screens&gt;</a></li><!-- ##api level 4## -->
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-feature-element.html">&lt;uses-feature&gt;</a></li> <!-- ##api level 4## -->
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-library-element.html">&lt;uses-library&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk&gt;</a></li>
</ul>
- </li>
+ </li><!-- end of the manifest file -->
+
+
<li class="nav-section">
<div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/ui/index.html">
@@ -259,44 +312,6 @@
</ul>
</li><!-- end of User Interface -->
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/resources/index.html">
- <span class="en">App Resources</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/overview.html">
- <span class="en">Overview</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/providing-resources.html">
- <span class="en">Providing Resources</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/accessing-resources.html">
- <span class="en">Accessing Resources</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/runtime-changes.html">
- <span class="en">Handling Runtime Changes</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/localization.html">
- <span class="en">Localization</span>
- </a></li>
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/resources/available-resources.html">
- <span class="en">Resource Types</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/animation-resource.html">Animation</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/color-list-resource.html">Color State List</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/drawable-resource.html">Drawable</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/layout-resource.html">Layout</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/menu-resource.html">Menu</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/string-resource.html">String</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/style-resource.html">Style</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/more-resources.html">More Types</a></li>
- </ul>
- </li><!-- end of resource types -->
- </ul>
- </li><!-- end of app resources -->
-
<li class="nav-section">
<div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/graphics/index.html">
<span class="en">Animation and Graphics</span>
@@ -527,9 +542,6 @@
<span class="zh-tw" style="display:none">最佳實務</span>
</div></a>
<ul>
- <li><a href="<?cs var:toroot ?>guide/practices/compatibility.html">
- <span class="en">Compatibility</span>
- </a></li>
<li class="nav-section">
<div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/screens_support.html">
<span class="en">Supporting Multiple Screens</span>
@@ -550,74 +562,7 @@
</ul>
</li>
- <!-- this needs to move
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/index.html">
- <span class="en">UI Guidelines</span>
- </a></div>
- <ul>
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design.html">
- <span class="en">Icon Design</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_launcher.html">
- <span class="en">Launcher Icons</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_menu.html">
- <span class="en">Menu Icons</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_action_bar.html">
- <span class="en">Action Bar Icons</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_status_bar.html">
- <span class="en">Status Bar Icons</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_tab.html">
- <span class="en">Tab Icons</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_dialog.html">
- <span class="en">Dialog Icons</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_list.html">
- <span class="en">List View Icons</span>
- </a></li>
- </ul>
- </li>
- <li><div><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/widget_design.html">
- <span class="en">App Widget Design</span>
- </a></div>
- </li>
- </ul>
- </li>
- </ul> -->
-
-<!-- Remove
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/appendix/index.html">
- <span class="en">Appendix</span>
- <span class="de" style="display:none">Anhang</span>
- <span class="es" style="display:none">Apéndice</span>
- <span class="fr" style="display:none">Annexes</span>
- <span class="it" style="display:none">Appendice</span>
- <span class="ja" style="display:none">付録</span>
- <span class="zh-cn" style="display:none">附录</span>
- <span class="zh-tw" style="display:none">附錄</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/appendix/g-app-intents.html">
- <span class="en">Intents List: Google Apps</span>
- </a></li>
-
- <li><a href="<?cs var:toroot ?>guide/appendix/glossary.html">
- <span class="en">Glossary</span>
- </a></li>
- </ul>
- </li>
-
-</li>
--->
</ul>
diff --git a/docs/html/guide/index.jd b/docs/html/guide/index.jd
new file mode 100644
index 0000000..d78a1b1
--- /dev/null
+++ b/docs/html/guide/index.jd
@@ -0,0 +1,75 @@
+page.title=Introduction to Android
+
+@jd:body
+
+
+<div class="sidebox" style="width:220px"><!-- width to match col-4 below -->
+<p>To learn how apps work, start with
+<a href="{@docRoot}guide/components/fundamentals.html">App Fundamentals</a>.</p>
+<p>To begin coding right away, read <a
+href="{@docRoot}training/basics/firstapp/index.html">Building Your First App</a>.</p>
+</div>
+
+<p>Android provides a rich application framework that allows you to build innovative apps and games
+for mobile devices in a Java language environment. The documents listed in the left
+navigation provide details about how to build apps using Android's various APIs.</p>
+
+<p>If you're new to Android development, it's important that you understand
+the following fundamental concepts about the Android app framework:</p>
+
+
+<div class="landing-banner">
+
+<div class="col-6">
+
+<h4>Apps provide multiple entry points</h4>
+
+<p>Android apps are built as a combination of distinct components that can be invoked
+individually. For instance, an individual <em>activity</em> provides a single
+screen for a user interface, and a <em>service</em> independently performs
+work in the background.</p>
+
+<p>From one component you can start another component using an <em>intent</em>. You can even start
+a component in a different app, such an activity in a maps app to show an address. This model
+provides multiple entry points for a single app and allows any app to behave as a user's "default"
+for an action that other apps may invoke.</p>
+
+
+<p><b>Learn more:</b></p>
+<ul class="nolist">
+<li><a href="{@docRoot}guide/components/fundamentals.html">App Fundamentals</a>
+<li><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
+<li><a href="{@docRoot}guide/components/activities.html">Activities</a>
+</ul>
+
+</div>
+
+
+<div class="col-6">
+
+<h4>Apps adapt to different devices</h4>
+
+<p>Android provides an adaptive app framework that allows you to provide unique resources
+for different device configurations. For example, you can create different XML
+layout files for different screen sizes and the system
+determines which layout to apply based on the current device's screen size.</p>
+
+<p>You can query the availability of device features at runtime if any app features require
+specific hardware such as a camera. If necessary, you can also declare features your app requires
+so app markets such as Google Play Store do not allow installation on devices that do not support
+that feature.</p>
+
+
+<p><b>Learn more:</b></p>
+<ul class="nolist">
+<li><a href="{@docRoot}guide/practices/compatibility.html">Device Compatibility</a>
+<li><a href="{@docRoot}guide/topics/resources/overview.html">Resources Overview</a>
+<li><a href="{@docRoot}guide/topics/ui/overview.html">User Interface Overview</a>
+</ul>
+
+</div>
+
+</div><!-- end landing-banner -->
+
+
+
diff --git a/docs/html/guide/practices/compatibility.jd b/docs/html/guide/practices/compatibility.jd
index 9e3d461..db1642e 100644
--- a/docs/html/guide/practices/compatibility.jd
+++ b/docs/html/guide/practices/compatibility.jd
@@ -1,248 +1,333 @@
-page.title=Android Compatibility
+page.title=Device Compatibility
excludeFromSuggestions=true
@jd:body
<div id="qv-wrapper">
<div id="qv">
+<h2>In this document</h2>
+<ol>
+ <li><a href="#defined">What Does "Compatibility" Mean?</a></li>
+ <li><a href="#how">Controlling Your App's Availability to Devices</a>
+ <ol>
+ <li><a href="#Features">Device features</a></li>
+ <li><a href="#Versions">Platform version</a></li>
+ <li><a href="#Screens">Screen configuration</a></li>
+ </ol>
+ </li>
+ <li><a href="#filtering">Controlling Your App's Availability for Business Reasons</a></li>
+</ol>
<h2>See also</h2>
<ol>
<li><a
href="{@docRoot}google/play/filters.html">Filtering on Google Play</a></li>
<li><a
-href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">Providing Alternative Resources</a></li>
-<li><a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></li>
-<li style="margin-top:3px;"><code><a
-href="{@docRoot}guide/topics/manifest/supports-screens-element.html">&lt;supports-screens&gt;</a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration&gt;</a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">&lt;uses-feature&gt;</a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/uses-library-element.html">&lt;uses-library&gt;</a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk&gt;</code></a></li>
+href="{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a></li>
+<li><a href="http://source.android.com/compatibility/index.html" class="external-link">
+Android Compatibility</a></li>
</ol>
</div> </div>
-<p>Android is designed to run on many different types of devices. For
-developers, the range and number of devices means a huge potential audience: the
-more devices that run Android apps, the more users who can access your app. In
-exchange, however, it also means that your apps will have to cope with that same
-variety of hardware.</p>
+<p>Android is designed to run on many different types of devices, from phones
+to tablets and televisions. As a developer,
+the range of devices provides a huge potential audience for your app. In order for your app
+to be successful on all these devices, it should tolerate some feature variability
+and provide a flexible user interface that adapts to different screen
+configurations.</p>
+
+<p>To facilitate your effort toward that goal, Android provides a dynamic app framework in which
+you can provide configuration-specific <a href="{@docRoot}guide/topics/resources/overview.html"
+>app resources</a> in static files (such as different XML layouts
+for different screen sizes). Android then loads the appropriate resources based on
+the current device configuration. So with some forethought to your app design and some additional
+app resources, you can publish a single application package (APK) that provides an optimized user
+experience on a variety of devices.
-<p>Fortunately, Android has built-in tools and support that make it easy for
-your apps to do that, while at the same time letting you maintain control of
-what types of devices your app is available to. With a bit of forethought and
-some minor changes in your app's manifest file, you can ensure that users
-whose devices can’t run your app will never see it on Google Play, and
-will not get in trouble by downloading it. This page explains how you can
-control which devices have access to your apps, and how to prepare your apps to
-make sure they reach the right audience.</p>
+<p>If necessary, however, you can specify your app's feature requirements and control
+which types of devices can install your app from Google Play Store. This page explains how you can
+control which devices have access to your apps, and how to prepare your apps to make sure they
+reach the right audience. For more information about how you can make your app adapt
+to different devices, read <a href="{@docRoot}training/basics/supporting-devices/index.html"
+>Supporting Different Devices</a>.</p>
-<h3 id="defined">What does “compatibility” mean?</h3>
-<p>A device is “Android compatible” if it can correctly run apps written for the
+<h2 id="defined">What Does "Compatibility" Mean?</h2>
+
+<p>As you read more about Android development, you'll probably encounter the term "compatibility"
+in various situations. There are two types of compatibility: <em>device compatibility</em>
+and <em>app compatibility</em>.
+
+<p>Because Android is an open source project, any hardware manufacturer can build a device
+that runs the Android operating system. Yet, a <b>device is "Android compatible"</b> only if
+it can correctly run apps written for the
<em>Android execution environment</em>. The exact details of the Android execution
-environment</em> are defined by the Android Compatibility Definition Document,
-but the single most important characteristic of a compatible device is the
-ability to install and correctly run an Android <code>.apk</code> file.</p>
+environment are defined by the <a href="http://source.android.com/compatibility/overview.html"
+class="external-link">Android compatibility program</a> and each device must pass the Compatibility
+Test Suite (CTS) in order to be considered compatible.</p>
-<p>There is exactly one Android API for each <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level</a>, and it’s the same
-API no matter what kind of device it’s installed on. No parts of the API are
-optional, and you never have to worry about parts of the API missing on some
-devices. Every compatible Android device your app will land on will include
-every class and every API for that API level.</p>
+<p>As an app developer, you don't need to worry about whether a device is Android compatible, because
+only devices that are Android compatible include Google Play Store. So you can rest assured that
+users who install your app from Google Play Store are using an Android compatible device.</p>
-<p>Of course, some APIs won’t work correctly if a particular device lacks the
-corresponding hardware or feature. But that’s not a problem: we also designed
-Android to prevent apps from being visible to devices which don’t have features
-the apps require. We’ve built support for this right into the SDK tools, and
-it’s part of the Android platform itself, as well as part of Google Play.</p>
-<p>As a developer, you have complete control of how and where your apps are
-available. Android provides tools as a first-class part of the platform that let
-you manage this. You control the availability of your apps, so that they reach
-only the devices capable of running them.</p>
+<p>However, you do need to consider whether your <b>app is compatible</b> with each potential
+device configuration. Because Android runs on a wide range of device configurations, some features are not
+available on all devices. For example, some devices may not include a
+compass sensor. If your app's core functionality requires the use
+of a compass sensor, then your app is compatible only with devices that
+include a compass sensor.</p>
-<h3 id="how">How does it work?</h3>
-<p>You manage your app’s availability through a simple three-step process:</p>
-<ol>
-<li>You state the features your app requires by declaring <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code>&lt;uses-feature&gt;</code></a>
-elements its manifest file.</li>
-<li>Devices are required to declare the features they include to Google
-Play.</li>
-<li>Google Play uses your app’s stated requirements to filter it from devices
-that don’t meet those requirements.</li>
-</ol>
-<p>This way, users never even see apps that won’t work properly on their
-devices. As long as you accurately describe your app’s requirements, you don’t
-need to worry about users blaming you for compatibility problems.</p>
-
-<p>If you’re familiar with web development, you may recognize this model as
-“capability detection”. Web developers typically prefer this approach to
-“browser detection”, because it’s very difficult to keep up as new browsers and
-new versions of current browsers are released. By checking for support for
-specific required capabilities instead of the current browser, web developers
-get better fine-grained control. That’s the same approach Android uses: since
-it’s impossible to keep up with all the Android devices being released, you
-instead use the fine-grained controls Android provides.</p>
-
-<h3>Filtering for technical reasons</h3>
-
- <div class="sidebox-wrapper">
- <img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
- <div id="qv-sub-rule">
- <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
- <p style="color:#669999;">Filtering on Google Play</p>
-
- <p>Google Play filters the applications that are visible to users, so
-that users can see and download only those applications that are compatible with
-their devices.</p>
-
- <p style="margin-top:1em;">One of the ways Google Play filters applications is by
-feature compatibility. To do this, Google Play checks the
-<code>&lt;uses-feature&gt;</code> elements in each application's manifest, to
-establish the app's feature needs. Google Play then shows or hides the application to
-each user, based on a comparison with the features available on the user's
-device.
-
-<p style="margin-top:1em;">For information about other filters that you can
-use to control the availability of your apps, see the
-<a href="{@docRoot}google/play/filters.html">Filters on Google Play</a>
-document.</p>
- </div>
-</div>
+<h2 id="how">Controlling Your App's Availability to Devices</h2>
+
+<p>Android supports a variety of features your app can leverage through platform APIs. Some
+features are hardware-based (such as a compass sensor), some are software-based (such as app
+widgets), and some are dependent on the platform version. Not every device supports every feature,
+so you may need to control your app's availability to devices based on your app's required
+features.</p>
-<p>Android includes support for a lot of features, some hardware and some
-software. Examples include compass and accelerometer sensors, cameras, and Live
-Wallpapers. However, not every device will support every feature. For instance,
-some devices don’t have the hardware horsepower to display Live Wallpapers
-well.</p>
-
-<p>To manage this, Android defines <em>feature IDs</em>. Every capability has a
-corresponding feature ID defined by the Android platform. For instance, the
-feature ID for compass is <code>“android.hardware.sensor.compass”</code>,
-while the feature
-ID for Live Wallpapers is <code>“android.software.live_wallpapers”</code>. Each of these IDs
-also has a corresponding Java-language constant on the
-{@link android.content.pm.PackageManager} class that you can use to query whether
-feature is supported at runtime. As Android adds support for new features in
-future versions, new feature IDs will be added as well.</p>
-
-<p>When you write your application, you specify which features your app requires
-by listing their feature IDs in <code>&lt;uses-feature&gt;</code> elements in
-the <code>AndroidManifest.xml</code> file. This is the information that Google
-Play uses to match your app to devices that can run it. For instance, if you
-state that your app requires android.software.live_wallpapers, it won’t be shown
-to devices that don’t support Live Wallpapers.</p>
-
-<p>This puts you in total control of your app &mdash; because you don’t have to
-declare these features. Consider an example involving cameras.</p>
-
-<p>If you’re building a really impressive next-generation augmented-reality app,
-your app won’t function at all without a camera. However, if you’re building a
-shopping app that only uses the camera for barcode scanning, users without
-cameras might still find it useful even if they can’t scan barcodes. While both
-apps need to acquire the permission to access the camera, only the first app
-needs to state that it requires a camera. (The shopping app can simply check at
-runtime and disable the camera-related features if there’s no camera
-present.)</p>
-
-<p>Since only you can say what the best approach is for your app, Android
-provides the tools and lets you make your own tradeoff between maximizing
-audience size and minimizing development costs.</p>
-
-
-<h3 id="filtering">Filtering for business reasons</h3>
-
-<p>It’s possible that you may need to restrict your app’s availability for
-business or legal reasons. For instance, an app that displays train schedules
-for the London Underground is unlikely to be useful to users outside the United
-Kingdom. Other apps might not be permitted in certain countries for business or
-legal reasons. For cases such as these, Google Play itself provides
-developers with filtering options that allow them control their app’s
-availability for non-technical reasons.</p>
-<p>The help information for Google Play provides full details, but in a
-nutshell, developers can use the Google Play publisher UI to:</p>
+<p>To achieve the largest user-base possible for your app, you should strive to support as many
+device configurations as possible using a single APK. In most situations, you can do so by
+disabling optional features at runtime and <a
+href="{@docRoot}guide/topics/resources/providing-resources.html">providing app resources</a>
+with alternatives for different configurations (such as different layouts for different
+screen sizes).
+If necessary, however, you can restrict your app's availability to devices through Google Play
+Store based on the following device characteristics:</p>
<ul>
-<li>List the countries an app is available in.</li>
-<li>Select which carrier’s users are able to access the app.</li>
+ <li><a href="#Features">Device features</a>
+ <li><a href="#Version">Platform version</a>
+ <li><a href="#Screens">Screen configuration</a>
</ul>
-<p>Filtering for technical compatibility (such as required hardware components)
-is always based on information contained within your <code>.apk</code> file. But
-filtering for non-technical reasons (such as geographic restrictions) is always
-handled in the Google Play user interface.</p>
-<h3 id="futureproofing">Future-proofing</h3>
+<h3 id="Features">Device features</h3>
+
+<p>In order for you to manage your app’s availability based on device features,
+Android defines <em>feature IDs</em> for any hardware or software feature
+that may not be available on all devices. For instance, the
+feature ID for the compass sensor is {@link
+android.content.pm.PackageManager#FEATURE_SENSOR_COMPASS} and the feature ID for app widgets
+is {@link android.content.pm.PackageManager#FEATURE_APP_WIDGETS}.</p>
+
+<p>If necessary, you can prevent users from installing your app when their devices don't provide a
+given feature by declaring it with a <a href=
+"{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature&gt;}</a>
+element in your app's <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">manifest
+file</a>.</p>
+
+<p>For example, if your app does not make sense on a device that lacks a compass sensor,
+you can declare the compass sensor as required with the following manifest tag:</p>
+
+<pre>
+&lt;manifest ... >
+ &lt;uses-feature android:name="android.hardware.sensor.compass"
+ android:required="true" />
+ ...
+&lt;/manifest>
+</pre>
+
+<p>Google Play Store compares the features your app requires to the features available on
+each user's device to determine whether your app is compatible with each device.
+If the device does not provide all the features your app requires, the user cannot install
+your app.</p>
+
+<p>However, if your app's primary functionality does not <em>require</em>
+a device feature, you should set the <a href=
+"{@docRoot}guide/topics/manifest/uses-feature-element.html#required">{@code required}</a>
+attribute to {@code "false"} and check
+for the device feature at runtime. If the app feature is not available on the current device,
+gracefully degrade the corresponding app feature. For example, you can query whether
+a feature is available by calling
+{@link android.content.pm.PackageManager#hasSystemFeature hasSystemFeature()} like this:</p>
+
+<pre>
+PackageManager pm = getPackageManager();
+if (!pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_COMPASS)) {
+ // This device does not have a compass, turn off the compass feature
+ disableCompassFeature();
+}
+</pre>
+
+<p>For information about all the filters you can
+use to control the availability of your app to users through Google Play Store, see the
+<a href="{@docRoot}google/play/filters.html">Filters on Google Play</a>
+document.</p>
+
+<p class="note"><strong>Note:</strong> Some <a href=
+"{@docRoot}guide/topics/security/permissions.html">system permissions</a> implicitly require the
+availability of a device feature. For example, if your app requests permission to access to {@link
+android.Manifest.permission#BLUETOOTH}, this implicitly requires the {@link
+android.content.pm.PackageManager#FEATURE_BLUETOOTH} device feature. You can disable filtering based
+on this feature and make your app available to devices without Bluetooth by setting the <a href=
+"{@docRoot}guide/topics/manifest/uses-feature-element.html#required">{@code required}</a> attribute
+to {@code "false"} in the <a href=
+"{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature&gt;}</a> tag.
+For more information about implicitly required device features, read <a href=
+"{@docRoot}guide/topics/manifest/uses-feature-element.html#permissions">Permissions that Imply
+Feature Requirements</a>.</p>
+
+
+
+
+
+
+
+<h3 id="Versions">Platform version</h3>
+
+<p>Different devices may run different versions of the Android platform,
+such as Android 4.0 or Android 4.4. Each successive platform version often adds new APIs not
+available in the previous version. To indicate which set of APIs are available, each
+platform version specifies an <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level</a>. For instance,
+Android 1.0 is API level 1 and Android 4.4 is API level 19.</p>
+
+<p>The API level allows you to declare the minimum version with which your app is
+compatible, using the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code
+&lt;uses-sdk>}</a> manifest tag and its <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> attribute.</p>
+
+<p>For example, the <a href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar
+Provider</a> APIs were added in Android 4.0 (API level 14). If your app cannot function without
+these APIs, you should declare API level 14 as your app's minimum supported
+version like this:</p>
-<p>There’s one additional quirk that we haven’t yet addressed: protecting apps
-from changes made to future versions of Android. If the Android platform
-introduces a new feature or changes how existing features are handled, what
-happens to existing apps that were written without any knowledge of the new
-behavior?</p>
+<pre>
+&lt;manifest ... >
+ &lt;uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
+ ...
+&lt;/manifest>
+</pre>
-<p>Simply put, Android commits to not making existing apps available to devices
-where they won’t work properly, even when the platform changes. The best way to
-explain this is through examples, so here are two:</p>
+<p>The <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+minSdkVersion}</a> attribute declares the minimum version with which your app is compatible
+and the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+targetSdkVersion}</a> attribute declares the highest version on which you've optimized
+your app.</p>
+
+<p>Each successive version of Android provides compatibility for apps that were built using
+the APIs from previous platform versions, so your app should always be compitible with future
+versions of Android while using the documented Android APIs.</p>
+
+<p class="note"><strong>Note:</strong>
+The <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+targetSdkVersion}</a> attribute does not prevent your app from being installed on platform
+versions that are higher than the specified value,
+but it is important because it indicates to the system whether your
+app should inherit behavior changes in newer versions. If you don't update the
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+targetSdkVersion}</a> to the latest version, the system assumes that your
+app requires some backward-compatibility behaviors when running on the latest version.
+For example, among the <a href="{@docRoot}about/versions/android-4.4.html#Behaviors"
+>behavior changes in Android 4.4</a>, alarms created with the {@link android.app.AlarmManager} APIs
+are now inexact by default so the system can batch app alarms and preserve system power,
+but the system will retain the previous API behavior for your app if your target API level
+is lower than "19".</p>
+
+<p>However, if your app uses APIs added in a more recent
+platform version, but does not require them for its primary functionality,
+you should check the API level at runtime and gracefully degrade
+the corresponding features when the API level is too low. In this case,
+set the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+minSdkVersion}</a> to the lowest value possible for your app's primary functionality,
+then compare the current system's version, {@link android.os.Build.VERSION#SDK_INT}, to one the
+codename constants in {@link android.os.Build.VERSION_CODES} that corresponds to the
+API level you want to check. For example:</p>
+
+<pre>
+if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
+ // Running on something older than API level 11, so disable
+ // the drag/drop features that use {@link android.content.ClipboardManager} APIs
+ disableDragAndDrop();
+}
+</pre>
+
+
+
+
+
+
+<h3 id="Screens">Screen configuration</h3>
+
+<p>Android runs on devices of various sizes, from phones to tablets and TVs.
+In order to categorize devices by their screen type, Android defines two characteristics for
+each device: screen size (the physical size of the screen) and screen density (the physical
+density of the pixels on the screen, known as <acronym title="dots per inch">DPI</acronym>).
+To simplify the different configurations, Android generalizes these variants into groups that make
+them easier to target:</p>
<ul>
-<li>Android 1.0 through 1.5 required a 2 megapixel camera with auto-focus.
-However, with version 1.6, Android devices were permitted to omit the auto-focus
-capability, though a (fixed-focus) camera was still required. Some apps such as
-barcode scanners do not function as well with cameras that do not auto-focus. To
-prevent users from having a bad experience with those apps, existing apps that
-obtain permission to use the Camera were assumed by default to require
-auto-focus. This allowed Google Play to filter those apps from devices that
-lack auto-focus.</li>
-
-<li>Android 2.2, meanwhile, allowed the microphone to be optional on some
-devices, such as set-top boxes. Android 2.2 included a new feature ID for the
-microphone which allows developers to filter their apps if necessary, but
-&mdash; as with camera &mdash; apps that obtain permission to record audio are
-assumed to require the microphone feature by default. If your app can use a
-microphone but doesn’t strictly need it, you can explicitly state that you don’t
-require it; but unless you do that, your app won’t be shown to devices without
-microphones.</li>
+ <li>Four generalized sizes: small, normal, large, and xlarge.</li>
+ <li>And several generalized densities: mdpi (medium), hdpi (hdpi), xhdpi (extra high),
+ xxhdpi (extra-extra high), and others.</li>
</ul>
-<p>In other words, whenever Android introduces new features or changes existing
-ones, we will always take steps to protect existing applications so that they
-don’t end up being available to devices where they won’t work.</p>
+<p>By default, your app is compatible with all screen sizes and densities,
+because the system makes the appropriate adjustments to your UI layout and image
+resources as necessary for each screen. However, you should optimize the user experience for each
+screen configuration by adding specialized layouts for different screen sizes and
+optimized bitmap images for common screen densities.</p>
+
+<p>For information about how to create alternative resources for different screens
+and how to restrict your app to certain screen sizes when necessary, read <a
+href="{@docRoot}training/basics/supporting-devices/screens.html">Supporting Different Screens</a>.
+</p>
+
+
-<p>This is implemented, in part, using the <code>aapt</code> tool in the SDK.
-To see which features your app explicitly requires or is implicitly assumed to
-require, you can use the command <code>aapt dump badging</code>.</p>
-<h3 id="conclusion">Conclusion</h3>
-<p>The goal of Android is to create a huge installed base for developers to take
-advantage of. One of the ways we will achieve this is through different kinds of
-hardware running the same software environment. But we also recognize that only
-developers know which kinds of devices their apps make sense on. We’ve built in
-tools to the SDK and set up policies and requirements to ensure that developers
-remain in control of their apps, today and in the future. With the information
-you just read, and the resources listed in the sidebar of this document, you
-can publish your app with the confidence that only users who can run it will
-see it.</p>
-<p>For more information about Android device compatibility, please visit:</p>
-<p style="margin-left:2em;"><a href="http://source.android.com/compatibility/index.html">http://source.android.com/compatibility/index.html</a></p>
+<h2 id="filtering">Controlling Your App's Availability for Business Reasons</h2>
- \ No newline at end of file
+<p>In addition to restricting your app's availability based on device characteristics,
+it’s possible you may need to restrict your app’s availability for
+business or legal reasons. For instance, an app that displays train schedules
+for the London Underground is unlikely to be useful to users outside the United
+Kingdom. For this type of situation, Google Play Store provides
+filtering options in the developer console that allow you to control your app’s
+availability for non-technical reasons such as the user's locale or wireless carrier.</p>
+
+<p>Filtering for technical compatibility (such as required hardware components)
+is always based on information contained within your APK file. But
+filtering for non-technical reasons (such as geographic locale) is always
+handled in the Google Play developer console.</p>
+
+
+
+
+
+
+<div class="next-docs">
+<div class="col-6">
+ <h2 class="norule">Continue reading about:</h2>
+ <dl>
+ <dt><a
+href="{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a></dt>
+ <dd>Information about how Android apps are structured to separate app resources from the
+ app code, including how you can provide alternative resources for specific device
+ configurations.
+ </dd>
+ <dt><a href="{@docRoot}google/play/filters.html">Filters on Google Play</a></dt>
+ <dd>Information about the different ways that Google Play Store can prevent your app
+ from being installed on different devices.</dd>
+ </dl>
+</div>
+<div class="col-6">
+ <h2 class="norule">You might also be interested in:</h2>
+ <dl>
+ <dt><a href="{@docRoot}guide/topics/security/permissions.html"
+ >System Permissions</a></dt>
+ <dd>How Android restricts app access to certain APIs with a permission system that requires
+ the user's consent for your app to use those APIs.</dd>
+ </dl>
+</div>
+</div>
diff --git a/docs/html/guide/practices/screens_support.jd b/docs/html/guide/practices/screens_support.jd
index ca29589..8c76411 100644
--- a/docs/html/guide/practices/screens_support.jd
+++ b/docs/html/guide/practices/screens_support.jd
@@ -25,8 +25,7 @@ page.title=Supporting Multiple Screens
<li><a href="#qualifiers">Using configuration qualifiers</a></li>
<li><a href="#DesigningResources">Designing alternative layouts and drawables</a></li>
</ol></li>
- <li><a href="#DeclaringTabletLayouts">Declaring Tablet Layouts for Android 3.2</a> <span
-class="new">new!</span>
+ <li><a href="#DeclaringTabletLayouts">Declaring Tablet Layouts for Android 3.2</a>
<ol>
<li><a href="#NewQualifiers">Using new size qualifiers</a></li>
<li><a href="#ConfigurationExamples">Configuration examples</a></li>
diff --git a/docs/html/guide/topics/connectivity/nfc/hce.jd b/docs/html/guide/topics/connectivity/nfc/hce.jd
index 4ef6859..d6efaa7 100644
--- a/docs/html/guide/topics/connectivity/nfc/hce.jd
+++ b/docs/html/guide/topics/connectivity/nfc/hce.jd
@@ -33,13 +33,13 @@ page.tags="host card emulation", "hce","HostApduService","OffHostApduService","t
-<p>Many Android-powered devices that offer NFC functionality already support NFC card
-emulation. In most cases, the card is emulated by a separate
-chip in the device, called a <em>secure element</em>. Many SIM cards provided by
+<p>Many Android-powered devices that offer NFC functionality already support NFC card
+emulation. In most cases, the card is emulated by a separate
+chip in the device, called a <em>secure element</em>. Many SIM cards provided by
wireless carriers also contain a secure element.</p>
-<p>Android 4.4 introduces an additional method of card emulation that does not
-involve a secure element, called <em>host-based card emulation</em>. This allows any
+<p>Android 4.4 introduces an additional method of card emulation that does not
+involve a secure element, called <em>host-based card emulation</em>. This allows any
Android application to emulate a card and talk directly to the NFC reader. This
document describes how host-based card emulation (HCE) works on Android and how you
can develop an app that emulates an NFC card using this technique.</p>
@@ -48,23 +48,23 @@ can develop an app that emulates an NFC card using this technique.</p>
<h2 id="SecureElement">Card Emulation with a Secure Element</h2>
<p>When NFC card emulation is provided using a secure element, the card to be emulated
-is provisioned into the secure element on
-the device through an Android application. Then, when the user holds the
-device over an NFC terminal, the NFC controller in the device routes all data
+is provisioned into the secure element on
+the device through an Android application. Then, when the user holds the
+device over an NFC terminal, the NFC controller in the device routes all data
from the reader directly to the secure element. Figure 1 illustrates this concept.</p>
<img src="{@docRoot}images/nfc/secure-element.png" />
<p class="img-caption"><strong>Figure 1.</strong> NFC card emulation with a secure element.</p>
-<p>The secure element itself performs the communication with the NFC terminal,
-and no Android application is involved in the transaction at all. After the
-transaction is complete, an Android application can query the secure element
+<p>The secure element itself performs the communication with the NFC terminal,
+and no Android application is involved in the transaction at all. After the
+transaction is complete, an Android application can query the secure element
directly for the transaction status and notify the user.</p>
<h2 id="HCE">Host-based Card Emulation</h2>
-<p>When an NFC card is emulated using host-based card emulation, the data is routed to
+<p>When an NFC card is emulated using host-based card emulation, the data is routed to
the host CPU on which Android applications are running directly, instead of routing the NFC
protocol frames to a secure element. Figure 2 illustrates how host-based card emulation
works.</p>
@@ -80,23 +80,23 @@ works.</p>
<p class="img-caption"><strong>Figure 3.</strong> Android's HCE protocol stack.</p>
</div>
-<p>The NFC standards offer support for many different protocols, and there are
+<p>The NFC standards offer support for many different protocols, and there are
different types of cards that can be emulated.</p>
-<p>Android 4.4 supports several protocols that are common in the
-market today. Many existing contactless cards are already based on these
-protocols, such as contactless payment cards. These protocols are also
-supported by many NFC readers in the market today, including Android NFC
+<p>Android 4.4 supports several protocols that are common in the
+market today. Many existing contactless cards are already based on these
+protocols, such as contactless payment cards. These protocols are also
+supported by many NFC readers in the market today, including Android NFC
devices functioning as readers themselves (see the {@link android.nfc.tech.IsoDep} class).
-This allows you to build and deploy an end-to-end NFC solution
+This allows you to build and deploy an end-to-end NFC solution
around HCE using only Android-powered devices.</p>
-<p>Specifically, Android 4.4 supports emulating cards that are based on the
-NFC-Forum ISO-DEP specification (based on ISO/IEC 14443-4) and process
-Application Protocol Data Units (APDUs) as defined in the ISO/IEC 7816-4
-specification. Android mandates emulating ISO-DEP only on top of the
-Nfc-A (ISO/IEC 14443-3 Type A) technology. Support for Nfc-B (ISO/IEC 14443-4
-Type B) technology is optional. The layering of all these specifications is
+<p>Specifically, Android 4.4 supports emulating cards that are based on the
+NFC-Forum ISO-DEP specification (based on ISO/IEC 14443-4) and process
+Application Protocol Data Units (APDUs) as defined in the ISO/IEC 7816-4
+specification. Android mandates emulating ISO-DEP only on top of the
+Nfc-A (ISO/IEC 14443-3 Type A) technology. Support for Nfc-B (ISO/IEC 14443-4
+Type B) technology is optional. The layering of all these specifications is
shown in the figure 3.</p>
@@ -105,12 +105,12 @@ shown in the figure 3.</p>
<p>The HCE architecture in Android is based around Android {@link android.app.Service} components
(known as "HCE services").
-One of the key advantages of a service is that it can run in the background without
-any user interface. This is a natural fit for many HCE applications like loyalty or transit cards,
-with which the user shouldn't need to launch the app to use it.
-Instead, tapping the device against the NFC reader starts the correct service (if not already
-running) and executes the transaction in the background. Of course, you are free
-to launch additional UI (such as user notifications) from your service if that makes
+One of the key advantages of a service is that it can run in the background without
+any user interface. This is a natural fit for many HCE applications like loyalty or transit cards,
+with which the user shouldn't need to launch the app to use it.
+Instead, tapping the device against the NFC reader starts the correct service (if not already
+running) and executes the transaction in the background. Of course, you are free
+to launch additional UI (such as user notifications) from your service if that makes
sense.</p>
@@ -118,72 +118,78 @@ sense.</p>
<h3 id="ServiceSelection">Service selection</h3>
<p>When the user taps a device to an NFC reader, the Android system needs to
- know which HCE service the NFC reader actually wants to talk to.
-This is where the ISO/IEC 7816-4 specification comes in: it defines a way to
-select applications, centered around an Application ID (AID). An AID
-consists of up to 16 bytes. If you are emulating cards for an existing NFC reader
-infrastructure, the AIDs that those readers are looking for are typically
-well-known and publicly registered (for example, the AIDs of payment networks
+know which HCE service the NFC reader actually wants to talk to.
+This is where the ISO/IEC 7816-4 specification comes in: it defines a way to
+select applications, centered around an Application ID (AID). An AID
+consists of up to 16 bytes. If you are emulating cards for an existing NFC reader
+infrastructure, the AIDs that those readers are looking for are typically
+well-known and publicly registered (for example, the AIDs of payment networks
such as Visa and MasterCard).</p>
-<p>If you want to deploy new reader infrastructure for your own application, you
-will need to register your own AID(s). The registration procedure for AIDs is
-defined in the ISO/IEC 7816-5 specification. Google recommends registering an
-AID as per 7816-5 if you are deploying a HCE application for Android, as it will avoid
+<p>If you want to deploy new reader infrastructure for your own application, you
+will need to register your own AID(s). The registration procedure for AIDs is
+defined in the ISO/IEC 7816-5 specification. Google recommends registering an
+AID as per 7816-5 if you are deploying a HCE application for Android, as it will avoid
collisions with other applications.</p>
<h3 id="AidGroups">AID groups</h3>
-<p>In some cases, an HCE service may need to register multiple AIDs to implement a
-certain application, and it needs to be sure that it is the default handler for
-all of these AIDs (as opposed to some AIDs in the group going to another
+<p>In some cases, an HCE service may need to register multiple AIDs to implement a
+certain application, and it needs to be sure that it is the default handler for
+all of these AIDs (as opposed to some AIDs in the group going to another
service).</p>
-<p>An AID group is a list of AIDs that should be considered as belonging together
-by the OS. For all AIDs in an AID group, Android guarantees one of the
+<p>An AID group is a list of AIDs that should be considered as belonging together
+by the OS. For all AIDs in an AID group, Android guarantees one of the
following:</p>
<ul>
<li>All AIDs in the group are routed to this HCE service</li>
-<li>No AIDs in the group are routed to this HCE service (for example, because the user
-preferred another service which requested one or more AIDs in your group as
+<li>No AIDs in the group are routed to this HCE service (for example, because the user
+preferred another service which requested one or more AIDs in your group as
well)</li>
</ul>
-<p>In other words, there is no in-between state, where some AIDs in the group can
+<p>In other words, there is no in-between state, where some AIDs in the group can
be routed to one HCE service, and some to another.</p>
<h3 id="GroupsCategories">AID groups and categories</h3>
-<p>Each AID group can be associated with a category. This allows Android to group
-HCE services together by category, and that in turn allows the user to set
-defaults at the category level instead of the AID level. In general, avoid
-mentioning AIDs in any user-facing parts of your application: they do not mean
+<p>Each AID group can be associated with a category. This allows Android to group
+HCE services together by category, and that in turn allows the user to set
+defaults at the category level instead of the AID level. In general, avoid
+mentioning AIDs in any user-facing parts of your application: they do not mean
anything to the average user.</p>
<p>Android 4.4 supports two categories: {@link
- android.nfc.cardemulation.CardEmulation#CATEGORY_PAYMENT} (covering payment
+android.nfc.cardemulation.CardEmulation#CATEGORY_PAYMENT} (covering industry-standard payment
apps) and {@link android.nfc.cardemulation.CardEmulation#CATEGORY_OTHER}
(for all other HCE apps).</p>
-
+<div class="note">
+ <p><strong>Note:</strong>
+ Only one AID group in the {@link
+ android.nfc.cardemulation.CardEmulation#CATEGORY_PAYMENT} category may be enabled in the system at any given time. Typically, this will be an app that understands major credit card payment protcols and which can work at any merchant.</p>
+ <p>For <em>closed-loop</em> payment apps that only work at one merchant (such as stored-value cards), you should use {@link
+ android.nfc.cardemulation.CardEmulation#CATEGORY_OTHER}. AID groups in this category can be always active, and can be given priority by NFC readers during AID selection if necessary.</p>
+</div>
<h2 id="ImplementingService">Implementing an HCE Service</h2>
<p>To emulate an NFC card using host-based card emulation, you need to create
- a {@link android.app.Service} component that handles the NFC transactions.
+ a {@link android.app.Service} component that handles the NFC transactions.
<h3 id="CheckingforSupport">Checking for HCE support</h3>
-<p>Your application can check whether a device supports HCE by checking for the
-{@link android.content.pm.PackageManager#FEATURE_NFC_HOST_CARD_EMULATION} feature. You should use the
-<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature>}</a> tag in the manifest of your application to declare that your app
+<p>Your application can check whether a device supports HCE by checking for the
+{@link android.content.pm.PackageManager#FEATURE_NFC_HOST_CARD_EMULATION} feature. You should use the
+<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature&gt;}</a> tag in the manifest of your application to declare that your app
uses the HCE feature, and whether it is required for the app to function or not.</p>
<h3 id="ServiceImplementation">Service implementation</h3>
-<p>Android 4.4 comes with a convenience {@link android.app.Service} class that can be used as a
+<p>Android 4.4 comes with a convenience {@link android.app.Service} class that can be used as a
basis for implementing a HCE service: the {@link android.nfc.cardemulation.HostApduService} class.</p>
<p>The first step is therefore to extend {@link android.nfc.cardemulation.HostApduService}.</p>
@@ -197,7 +203,7 @@ public class MyHostApduService extends HostApduService {
&#64;Override
public void onDeactivated(int reason) {
...
- }
+ }
}
</pre>
@@ -205,238 +211,237 @@ public class MyHostApduService extends HostApduService {
declares two abstract methods that need to be overridden and implemented.</p>
<p>{@link android.nfc.cardemulation.HostApduService#processCommandApdu processCommandApdu()}
- is called whenever a NFC reader sends an Application
-Protocol Data Unit (APDU) to your service. APDUs are defined in the ISO/IEC
-7816-4 specification as well. APDUs are the application-level packets being
-exchanged between the NFC reader and your HCE service. That application-level
-protocol is half-duplex: the NFC reader will send you a command APDU, and it
+is called whenever a NFC reader sends an Application
+Protocol Data Unit (APDU) to your service. APDUs are defined in the ISO/IEC
+7816-4 specification as well. APDUs are the application-level packets being
+exchanged between the NFC reader and your HCE service. That application-level
+protocol is half-duplex: the NFC reader will send you a command APDU, and it
will wait for you to send a response APDU in return.</p>
<p class="note"><strong>Note:</strong>
- The ISO/IEC 7816-4 specification also defines the concept of multiple logical channels,
- where you can have multiple parallel APDU exchanges on separate logical channels. Android’s
- HCE implementation however only supports a single logical channel, so there’s only a
- single-threaded exchange of APDUs.</p>
-
-
-<p>As mentioned previously, Android uses the AID to determine which HCE service the
-reader wants to talk to. Typically, the first APDU an NFC reader sends to your
-device is a "SELECT AID" APDU; this APDU contains the AID that the reader wants
-to talk to. Android extracts that AID from the APDU, resolves it to an HCE service,
+ The ISO/IEC 7816-4 specification also defines the concept of multiple logical channels,
+ where you can have multiple parallel APDU exchanges on separate logical channels. Android’s
+ HCE implementation however only supports a single logical channel, so there’s only a
+ single-threaded exchange of APDUs.</p>
+
+
+<p>As mentioned previously, Android uses the AID to determine which HCE service the
+reader wants to talk to. Typically, the first APDU an NFC reader sends to your
+device is a "SELECT AID" APDU; this APDU contains the AID that the reader wants
+to talk to. Android extracts that AID from the APDU, resolves it to an HCE service,
then forwards that APDU to the resolved service.</p>
-<p>You can send a response APDU by returning the bytes of the response APDU from
+<p>You can send a response APDU by returning the bytes of the response APDU from
{@link android.nfc.cardemulation.HostApduService#processCommandApdu processCommandApdu()}.
- Note that this method will be called on the main thread of
-your application, which shouldn't be blocked. So if you can't compute and return
-a response APDU immediately, return null. You can then do the necessary work on
-another thread, and use the {@link android.nfc.cardemulation.HostApduService#sendResponseApdu
- sendResponseApdu()} method defined
+ Note that this method will be called on the main thread of
+your application, which shouldn't be blocked. So if you can't compute and return
+a response APDU immediately, return null. You can then do the necessary work on
+another thread, and use the {@link android.nfc.cardemulation.HostApduService#sendResponseApdu sendResponseApdu()} method defined
in the {@link android.nfc.cardemulation.HostApduService} class to send the response when you are done.</p>
-<p>Android will keep forwarding new APDUs from the reader to your service, until
+<p>Android will keep forwarding new APDUs from the reader to your service, until
either:</p>
<ol>
-<li>The NFC reader sends another "SELECT AID" APDU, which the OS resolves to a
+<li>The NFC reader sends another "SELECT AID" APDU, which the OS resolves to a
different service;</li>
<li>The NFC link between the NFC reader and your device is broken.</li>
</ol>
<p>In both of these cases, your class's
- {@link android.nfc.cardemulation.HostApduService#onDeactivated onDeactivated()}
- implementation is
+{@link android.nfc.cardemulation.HostApduService#onDeactivated onDeactivated()}
+implementation is
called with an argument indicating which of the two happened.</p>
-<p>If you are working with existing reader infrastructure, you need to
-implement the existing application-level protocol that the readers expect in
+<p>If you are working with existing reader infrastructure, you need to
+implement the existing application-level protocol that the readers expect in
your HCE service.</p>
-<p>If you are deploying new reader infrastructure which you control as well, you
-can define your own protocol and APDU sequence. In general try to limit the
-amount of APDUs and the size of the data that needs to be exchanged: this makes
-sure that your users will only have to hold their device over the NFC reader for
-a short amount of time. A sane upper bound is about 1KB of data, which can
+<p>If you are deploying new reader infrastructure which you control as well, you
+can define your own protocol and APDU sequence. In general try to limit the
+amount of APDUs and the size of the data that needs to be exchanged: this makes
+sure that your users will only have to hold their device over the NFC reader for
+a short amount of time. A sane upper bound is about 1KB of data, which can
usually be exchanged within 300ms.</p>
<h3 id="ManifestDeclaration">Service manifest declaration and AID registration</h3>
-<p>Your service must be declared in the manifest as usual, but some additional
+<p>Your service must be declared in the manifest as usual, but some additional
pieces must be added to the service declaration as well.</p>
-<p>First, to tell the platform that it is a HCE service implementing a
-{@link android.nfc.cardemulation.HostApduService} interface, your service declaration must contain an
+<p>First, to tell the platform that it is a HCE service implementing a
+{@link android.nfc.cardemulation.HostApduService} interface, your service declaration must contain an
intent filter for the {@link android.nfc.cardemulation.HostApduService#SERVICE_INTERFACE} action.</p>
-<p>Additionally, to tell the platform which AIDs groups are requested by this
-service, a {@link android.nfc.cardemulation.HostApduService#SERVICE_META_DATA}
-<code>&lt;meta-data></code> tag must be included in
-the declaration of the service, pointing to an XML resource with additional
+<p>Additionally, to tell the platform which AIDs groups are requested by this
+service, a {@link android.nfc.cardemulation.HostApduService#SERVICE_META_DATA}
+<code>&lt;meta-data&gt;</code> tag must be included in
+the declaration of the service, pointing to an XML resource with additional
information about the HCE service.</p>
-<p>Finally, you must set the {@code android:exported} attribute to true, and require the
-{@code "android.permission.BIND_NFC_SERVICE"} permission in your service declaration.
-The former ensures that the service can be bound to by external applications.
-The latter then enforces that only external applications that hold the
-{@code ""android.permission.BIND_NFC_SERVICE"} permission can bind to your service. Since
-{@code ""android.permission.BIND_NFC_SERVICE"} is a system permission, this effectively
+<p>Finally, you must set the {@code android:exported} attribute to true, and require the
+{@code "android.permission.BIND_NFC_SERVICE"} permission in your service declaration.
+The former ensures that the service can be bound to by external applications.
+The latter then enforces that only external applications that hold the
+{@code "android.permission.BIND_NFC_SERVICE"} permission can bind to your service. Since
+{@code "android.permission.BIND_NFC_SERVICE"} is a system permission, this effectively
enforces that only the Android OS can bind to your service. </p>
<p>Here's an example of a {@link android.nfc.cardemulation.HostApduService} manifest declaration:</p>
<pre>
&lt;service android:name=".MyHostApduService" android:exported="true"
- android:permission="android.permission.BIND_NFC_SERVICE">
- &lt;intent-filter>
- &lt;action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE"/>
- &lt;/intent-filter>
+ android:permission="android.permission.BIND_NFC_SERVICE"&gt;
+ &lt;intent-filter&gt;
+ &lt;action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE"/&gt;
+ &lt;/intent-filter&gt;
&lt;meta-data android:name="android.nfc.cardemulation.host_apdu_service"
- android:resource="@xml/apduservice"/>
-&lt;/service>
+ android:resource="@xml/apduservice"/&gt;
+&lt;/service&gt;
</pre>
-<p>This meta-data tag points to an {@code apduservice.xml} file. An example of such a file
-with a single AID group declaration containing two proprietary AIDs is shown
+<p>This meta-data tag points to an {@code apduservice.xml} file. An example of such a file
+with a single AID group declaration containing two proprietary AIDs is shown
below:</p>
<pre>
&lt;host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
- android:description="@string/servicedesc"
- android:requireDeviceUnlock="false">
- &lt;aid-group android:description="@string/aiddescription"
- android:category="other">
- &lt;aid-filter android:name="F0010203040506"/>
- &lt;aid-filter android:name="F0394148148100"/>
- &lt;/aid-group>
-&lt;/host-apdu-service>
+ android:description="@string/servicedesc"
+ android:requireDeviceUnlock="false"&gt;
+ &lt;aid-group android:description="@string/aiddescription"
+ android:category="other"&gt;
+ &lt;aid-filter android:name="F0010203040506"/&gt;
+ &lt;aid-filter android:name="F0394148148100"/&gt;
+ &lt;/aid-group&gt;
+&lt;/host-apdu-service&gt;
</pre>
-<p>The <code>&lt;host-apdu-service></code> tag is required to contain a <code>&lt;android:description></code>
-attribute that contains a user-friendly description of the service that may be
-shown in UI. The <code>&lt;requireDeviceUnlock></code> attribute can be used to specify that the
+<p>The <code>&lt;host-apdu-service&gt;</code> tag is required to contain a <code>&lt;android:description&gt;</code>
+attribute that contains a user-friendly description of the service that may be
+shown in UI. The <code>requireDeviceUnlock</code> attribute can be used to specify that the
device must be unlocked before this service can be invoked to handle APDUs.</p>
-<p>The <code>&lt;host-apdu-service></code> must contain one or more <code>&lt;aid-group></code> tags. Each
-<code>&lt;aid-group></code> tag is required to contain a <code>android:description</code> attribute that
-contains a user-friendly description of the AID group that may be shown in UI.
-Each <code>&lt;aid-group></code> tag must also have the android:category attribute set to
-indicate the category the AID group belongs to, e.g. the string constants
-defined by CardEmulation.CATEGORY_PAYMENT or CardEmulation.CATEGORY_OTHER. Each
-<code>&lt;aid-group></code> must contain one or more <code>&lt;aid-filter></code> tags, each of which contains a
-single AID. The AID must be specified in hexadecimal format, and contain an even
-number of characters.</p>
-
-<p>As a final note, your application also needs to hold the NFC permission,
- {@link android.Manifest.permission#NFC} to be able to register as a HCE service.</p>
-
+<p>The <code>&lt;host-apdu-service&gt;</code> must contain one or more <code>&lt;aid-group&gt;</code> tags. Each
+<code>&lt;aid-group&gt;</code> tag is required to:</p>
+<ul>
+<li>Contain an <code>android:description</code> attribute that
+contains a user-friendly description of the AID group, suitable for display in UI.</li>
+<li>Have its <code>android:category</code> attribute set to
+indicate the category the AID group belongs to, e.g. the string constants
+defined by {@link android.nfc.cardemulation.CardEmulation#CATEGORY_PAYMENT}
+or {@link android.nfc.cardemulation.CardEmulation#CATEGORY_OTHER}.</li>
+<li>Each <code>&lt;aid-group&gt;</code> must contain one or more
+<code>&lt;aid-filter&gt;</code> tags, each of which contains a single AID. The AID
+must be specified in hexadecimal format, and contain an even number of characters.</li>
+</ul>
+<p>As a final note, your application also needs to hold the
+{@link android.Manifest.permission#NFC} permission to be able to register as a HCE service.</p>
<h2 id="AidConflicts">AID Conflict Resolution</h2>
<p>Multiple {@link android.nfc.cardemulation.HostApduService} components
- may be installed on a single device, and the same AID
-can be registered by more than one service. The Android platform resolves AID
-conflicts depending on which category an AID belongs to. Each category may have
-a different conflict resolution policy. </p>
-
-<p>For example, for some categories (like payment) the user may be able to select a
-default service in the Android settings UI. For other categories, the policy may
-be to always ask the user which service is to be invoked in case of conflict. To
-query the conflict resolution policy for a certain category, see
+may be installed on a single device, and the same AID
+can be registered by more than one service. The Android platform resolves AID
+conflicts depending on which category an AID belongs to. Each category may have
+a different conflict resolution policy.</p>
+
+<p>For example, for some categories (like payment) the user may be able to select a
+default service in the Android settings UI. For other categories, the policy may
+be to always ask the user which service is to be invoked in case of conflict. To
+query the conflict resolution policy for a certain category, see
{@link android.nfc.cardemulation.CardEmulation#getSelectionModeForCategory
- getSelectionModeForCategory()}.</p>
+getSelectionModeForCategory()}.</p>
<h3 id="CheckingIfDefault">Checking if your service is the default</h3>
-<p>Applications can check whether their HCE service is the default service for a
-certain category by using the
+<p>Applications can check whether their HCE service is the default service for a
+certain category by using the
{@link android.nfc.cardemulation.CardEmulation#isDefaultServiceForCategory} API.</p>
-<p>If your service is not the default, you can request it to be made the default.
+<p>If your service is not the default, you can request it to be made the default.
See {@link android.nfc.cardemulation.CardEmulation#ACTION_CHANGE_DEFAULT}.</p>
-
-
<h2 id="PaymentApps">Payment Applications</h2>
-<p>Android considers HCE services that have declared an AID group with the
-"payment" category as payment applications. The Android 4.4 release contains a
-top-level Settings menu entry called "tap &amp; pay", which enumerates all such
-payment applications. In this settings menu, the user can select the default
+<p>Android considers HCE services that have declared an AID group with the
+"payment" category as payment applications. The Android 4.4 release contains a
+top-level Settings menu entry called "tap &amp; pay", which enumerates all such
+payment applications. In this settings menu, the user can select the default
payment application that will be invoked when a payment terminal is tapped.</p>
<h3 id="RequiredAssets">Required assets for payment applications</h3>
-<p>To provide a more visually attractive user experience, HCE payment applications
-are required to provide an additional asset for their service: a so-called
+<p>To provide a more visually attractive user experience, HCE payment applications
+are required to provide an additional asset for their service: a so-called
service banner.</p>
-<p>This asset should be sized 260x96 dp, and can be specified in your meta-data XML
-file by adding the <code>android:apduServiceBanner</code> attribute to the
-<code>&lt;host-apdu-service></code> tag, which points to the drawable resource. An example is
+<p>This asset should be sized 260x96 dp, and can be specified in your meta-data XML
+file by adding the <code>android:apduServiceBanner</code> attribute to the
+<code>&lt;host-apdu-service&gt;</code> tag, which points to the drawable resource. An example is
shown below:</p>
<pre>
&lt;host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
- android:description="@string/servicedesc"
+ android:description="@string/servicedesc"
android:requireDeviceUnlock="false"
- android:apduServiceBanner="@drawable/my_banner">
+ android:apduServiceBanner="@drawable/my_banner"&gt;
&lt;aid-group android:description="@string/aiddescription"
- android:category="payment">
- &lt;aid-filter android:name="F0010203040506"/>
- &lt;aid-filter android:name="F0394148148100"/>
- &lt;/aid-group>
-&lt;/host-apdu-service>
+ android:category="payment"&gt;
+ &lt;aid-filter android:name="F0010203040506"/&gt;
+ &lt;aid-filter android:name="F0394148148100"/&gt;
+ &lt;/aid-group&gt;
+&lt;/host-apdu-service&gt;
</pre>
<h2 id="ScreenOffBehavior">Screen Off and Lock-screen Behavior</h2>
-<p>Current Android implementations turn the NFC controller and the application
-processor off completely when the screen of the device is turned off. HCE
+<p>Current Android implementations turn the NFC controller and the application
+processor off completely when the screen of the device is turned off. HCE
services will therefore not work when the screen is off.</p>
-<p>HCE services can function from the lock-screen however: this is controlled by
-the <code>android:requireDeviceUnlock</code> attribute in the <code>&lt;host-apdu-service></code> tag of your
-HCE service. By default, device unlock is not required, and your service will be
+<p>HCE services can function from the lock-screen however: this is controlled by
+the <code>android:requireDeviceUnlock</code> attribute in the <code>&lt;host-apdu-service&gt;</code> tag of your
+HCE service. By default, device unlock is not required, and your service will be
invoked even if the device is locked.</p>
-<p>If you set the <code>&lt;android:requireDeviceUnlock</code> attribute to "true" for your HCE
-service, Android will prompt the user to unlock the device when you tap an NFC
-reader that selects an AID that is resolved to your service. After unlocking,
-Android will show a dialog prompting the user to tap again to complete the
-transaction. This is necessary because the user may have moved the device away
+<p>If you set the <code>android:requireDeviceUnlock</code> attribute to "true" for your HCE
+service, Android will prompt the user to unlock the device when you tap an NFC
+reader that selects an AID that is resolved to your service. After unlocking,
+Android will show a dialog prompting the user to tap again to complete the
+transaction. This is necessary because the user may have moved the device away
from the NFC reader in order to unlock it.</p>
<h2 id="Coexistence">Coexistence with Secure Element Cards</h2>
-<p>This section is of interest for developers that have deployed an application
-that relies on a secure element for card emulation. Android's HCE implementation
-is designed to work in parallel with other methods of implementing card
+<p>This section is of interest for developers that have deployed an application
+that relies on a secure element for card emulation. Android's HCE implementation
+is designed to work in parallel with other methods of implementing card
emulation, including the use of secure elements.</p>
<p class="note"><strong>Note:</strong> Android does not offer APIs for directly communicating with a secure element itself.</p>
-<p>This coexistence is based on a principle called "AID routing": the NFC
-controller keeps a routing table that consists of a (finite) list of routing
-rules. Each routing rule contains an AID and a destination. The destination can
-either be the host CPU (where Android apps are running), or a connected secure
+<p>This coexistence is based on a principle called "AID routing": the NFC
+controller keeps a routing table that consists of a (finite) list of routing
+rules. Each routing rule contains an AID and a destination. The destination can
+either be the host CPU (where Android apps are running), or a connected secure
element.</p>
-<p>When the NFC reader sends an APDU with a "SELECT AID", the NFC controller parses
-it and checks whether the AIDs matchesNo converter for: FOOTNOTE with any AID in
-its routing table. If it matches, that APDU and all APDUs following it will be
-sent to the destination associated with the AID, until another "SELECT AID" APDU
-is received or the NFC link is broken.</p>
+<p>When the NFC reader sends an APDU with a "SELECT AID", the NFC controller parses
+it and checks whether the AIDs matches with any AID in its routing table. If it
+matches, that APDU and all APDUs following it will be sent to the destination
+associated with the AID, until another "SELECT AID" APDU is received or the NFC
+link is broken.</p>
<p class="note"><strong>Note:</strong>
- While ISO/IEC 7816-4 defines the concept of “partial matches” as well, this is currently not supported by Android HCE devices.</p>
-
+While ISO/IEC 7816-4 defines the concept of “partial matches” as well, this is currently not supported by Android HCE devices.</p>
+
<p>This architecture is illustrated in figure 4.</p>
@@ -445,46 +450,46 @@ is received or the NFC link is broken.</p>
and host-card emulation.</p>
-<p>The NFC controller typically also contains a default route for APDUs. When an
-AID is not found in the routing table, the default route is used. Beginning with Android
-4.4, the default route is required to be set to the host CPU. This
-means that the routing table typically only contains entries for AIDs that need
+<p>The NFC controller typically also contains a default route for APDUs. When an
+AID is not found in the routing table, the default route is used. Beginning with Android
+4.4, the default route is required to be set to the host CPU. This
+means that the routing table typically only contains entries for AIDs that need
to go to a secure element.</p>
-<p>Android applications that implement a HCE service or that use a secure element
-don't have to worry about configuring the routing table - that is taking care of
-by Android automatically. Android merely needs to know which AIDs can be handled
-by HCE services and which ones can be handled by the secure element. Based on
-which services are installed and which the user has configured as preferred, the
+<p>Android applications that implement a HCE service or that use a secure element
+don't have to worry about configuring the routing table - that is taking care of
+by Android automatically. Android merely needs to know which AIDs can be handled
+by HCE services and which ones can be handled by the secure element. Based on
+which services are installed and which the user has configured as preferred, the
routing table is configured automatically.</p>
-<p>We've already described how to declare AIDs for HCE services. The following
-section explains how to declare AIDs for applications that use a secure element
+<p>We've already described how to declare AIDs for HCE services. The following
+section explains how to declare AIDs for applications that use a secure element
for card emulation.</p>
<h3 id="SecureElementReg">Secure element AID registration</h3>
-<p>Applications using a secure element for card emulation can declare a so-called
-"off host service" in their manifest. The declaration of such a service is
+<p>Applications using a secure element for card emulation can declare a so-called
+"off host service" in their manifest. The declaration of such a service is
almost identical to the declaration of a HCE service. The exceptions are:</p>
<ul>
-<li>The action used in the intent-filter must be set to
-{@link android.nfc.cardemulation.OffHostApduService#SERVICE_INTERFACE}</li>
-<li>The meta-data name attribute must be set to
-{@link android.nfc.cardemulation.OffHostApduService#SERVICE_META_DATA}</li>
-<li><p>The meta-data XML file must use the <code>&lt;offhost-apdu-service></code> root tag</p>
+<li>The action used in the intent-filter must be set to
+{@link android.nfc.cardemulation.OffHostApduService#SERVICE_INTERFACE}.</li>
+<li>The meta-data name attribute must be set to
+{@link android.nfc.cardemulation.OffHostApduService#SERVICE_META_DATA}.</li>
+<li><p>The meta-data XML file must use the <code>&lt;offhost-apdu-service&gt;</code> root tag.</p>
<pre>
&lt;service android:name=".MyOffHostApduService" android:exported="true"
- android:permission="android.permission.BIND_NFC_SERVICE">
- &lt;intent-filter>
- &lt;action android:name="android.nfc.cardemulation.action.OFF_HOST_APDU_SERVICE"/>
- &lt;/intent-filter>
+ android:permission="android.permission.BIND_NFC_SERVICE"&gt;
+ &lt;intent-filter&gt;
+ &lt;action android:name="android.nfc.cardemulation.action.OFF_HOST_APDU_SERVICE"/&gt;
+ &lt;/intent-filter&gt;
&lt;meta-data android:name="android.nfc.cardemulation.off_host_apdu_ervice"
- android:resource="@xml/apduservice"/>
-&lt;/service>
+ android:resource="@xml/apduservice"/&gt;
+&lt;/service&gt;
</pre>
</li>
</ul>
@@ -493,126 +498,126 @@ almost identical to the declaration of a HCE service. The exceptions are:</p>
<pre>
&lt;offhost-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
- android:description="@string/servicedesc">
- &lt;aid-group android:description="@string/subscription" android:category="other">
- &lt;aid-filter android:name="F0010203040506"/>
- &lt;aid-filter android:name="F0394148148100"/>
- &lt;/aid-group>
-&lt;/offhost-apdu-service>
+ android:description="@string/servicedesc"&gt;
+ &lt;aid-group android:description="@string/subscription" android:category="other"&gt;
+ &lt;aid-filter android:name="F0010203040506"/&gt;
+ &lt;aid-filter android:name="F0394148148100"/&gt;
+ &lt;/aid-group&gt;
+&lt;/offhost-apdu-service&gt;
</pre>
-<p>The <code>android:requireDeviceUnlock</code> attribute does not apply to off host services,
-because the host CPU is not involved in the transaction and therefore cannot
-prevent the secure element from executing transactions when the device is
+<p>The <code>android:requireDeviceUnlock</code> attribute does not apply to off host services,
+because the host CPU is not involved in the transaction and therefore cannot
+prevent the secure element from executing transactions when the device is
locked.</p>
-<p>The <code>android:apduServiceBanner</code> attribute must be used for off host services that
-are payment applications as well in order to be selectable as a default payment
+<p>The <code>android:apduServiceBanner</code> attribute must be used for off host services that
+are payment applications as well in order to be selectable as a default payment
application.</p>
<h3 id="OffHostInvocation">Off host service invocation</h3>
-<p>Android itself will never start or bind to a service that is declared as "off
-host". This is because the actual transactions are executed by the secure
-element and not by the Android service itself. The service declaration merely
+<p>Android itself will never start or bind to a service that is declared as "off
+host". This is because the actual transactions are executed by the secure
+element and not by the Android service itself. The service declaration merely
allows applications to register AIDs present on the secure element.</p>
<h2 id="HceSecurity">HCE and Security</h2>
-<p>The HCE architecture itself provides one core piece of security: because your
+<p>The HCE architecture itself provides one core piece of security: because your
service is protected by the {@link android.Manifest.permission#BIND_NFC_SERVICE}
- system permission, only the OS can
-bind to and communicate with your service. This ensures that any APDU you
-receive is actually an APDU that was received by the OS from the NFC controller,
-and that any APDU you send back will only go to the OS, which in turn directly
+ system permission, only the OS can
+bind to and communicate with your service. This ensures that any APDU you
+receive is actually an APDU that was received by the OS from the NFC controller,
+and that any APDU you send back will only go to the OS, which in turn directly
forwards the APDUs to the NFC controller.</p>
-<p>The core remaining piece is where you get the data from that you're sending back
-to the NFC reader. This is intentionally decoupled in the HCE design: it does
-not care where the data comes from, it just makes sure that it is safely
+<p>The core remaining piece is where you get your data that your app sends
+to the NFC reader. This is intentionally decoupled in the HCE design: it does
+not care where the data comes from, it just makes sure that it is safely
transported to the NFC controller and out to the NFC reader.</p>
-<p>For securely storing and retrieving the data that you want to send from your HCE
-service, you can for example rely on the Android Application Sandbox, which
-isolates your app's data from other apps. For more details on Android security,
-read
-<a href="{@docRoot}training/articles/security-tips.html">Security Tips</a>
+<p>For securely storing and retrieving the data that you want to send from your HCE
+service, you can, for example, rely on the Android Application Sandbox, which
+isolates your app's data from other apps. For more details on Android security,
+read
+<a href="{@docRoot}training/articles/security-tips.html">Security Tips</a>
.</p>
<h2 id="ProtocolParams">Protocol parameters and details</h2>
-<p>This section is of interest for developers that want to understand what protocol
-parameters HCE devices use during the anti-collision and activations phases of
-the NFC protocols. This allows them to build a reader infrastructure that is
+<p>This section is of interest for developers that want to understand what protocol
+parameters HCE devices use during the anti-collision and activation phases of
+the NFC protocols. This allows building a reader infrastructure that is
compatible with Android HCE devices.</p>
<h3 id="AntiCollisionAct">Nfc-A (ISO/IEC 14443 type A) protocol anti-collision and activation</h3>
<p>As part of the Nfc-A protocol activation, multiple frames are exchanged.</p>
-<p>In the first part of the exchange the HCE device will present its UID; HCE
-devices should be assumed to have a random UID. This means that on every tap,
-the UID that is presented to the reader will be a randomly generated UID.
-Because of this, NFC readers should not depend on the UID of HCE devices as a
+<p>In the first part of the exchange the HCE device will present its UID; HCE
+devices should be assumed to have a random UID. This means that on every tap,
+the UID that is presented to the reader will be a randomly generated UID.
+Because of this, NFC readers should not depend on the UID of HCE devices as a
form of authentication or identification.</p>
-<p>The NFC reader can subsequently select the HCE device by sending a SEL_REQ
-command. The SEL_RES response of the HCE device will at least have the 6th bit
-(0x20) set, indicating that the device supports ISO-DEP. Note that other bits in
-the SEL_RES may be set as well, indicating for example support for the NFC-DEP
-(p2p) protocol. Since other bits may be set, readers wanting to interact with
-HCE devices should explicitly check for the 6th bit only, and <stront>not</strong> compare the
+<p>The NFC reader can subsequently select the HCE device by sending a SEL_REQ
+command. The SEL_RES response of the HCE device will at least have the 6th bit
+(0x20) set, indicating that the device supports ISO-DEP. Note that other bits in
+the SEL_RES may be set as well, indicating for example support for the NFC-DEP
+(p2p) protocol. Since other bits may be set, readers wanting to interact with
+HCE devices should explicitly check for the 6th bit only, and <stront>not</strong> compare the
complete SEL_RES with a value of 0x20.</p>
<h3 id="IsoDepAct">ISO-DEP activation</h3>
-<p>After the Nfc-A protocol is activated, the ISO-DEP protocol activation is
-initiated by the NFC reader. It sends a "RATS" (Request for Answer To Select)
-command. The RATS response, the ATS, is completely generated by the NFC
-controller and not configurable by HCE services. However, HCE implementations
-are required to meet NFC Forum requirements for the ATS response, so NFC readers
-can count on these parameters being set in accordance with NFC Forum
+<p>After the Nfc-A protocol is activated, the ISO-DEP protocol activation is
+initiated by the NFC reader. It sends a "RATS" (Request for Answer To Select)
+command. The RATS response, the ATS, is completely generated by the NFC
+controller and not configurable by HCE services. However, HCE implementations
+are required to meet NFC Forum requirements for the ATS response, so NFC readers
+can count on these parameters being set in accordance with NFC Forum
requirements for any HCE device.</p>
-<p>The section below provides more details on the individual bytes of the ATS
+<p>The section below provides more details on the individual bytes of the ATS
response provided by the NFC controller on a HCE device:</p>
<ul>
-<li>TL: length of the ATS response. Must not indicate a length greater than 20
+<li>TL: length of the ATS response. Must not indicate a length greater than 20
bytes.</li>
-<li>T0: bits 5, 6 and 7 must be set on all HCE devices, indicating TA(1), TB(1)
-and TC(1) are included in the ATS response. Bits 1 to 4 indicate the FSCI,
-coding the maximum frame size. On HCE devices the value of FSCI must be
+<li>T0: bits 5, 6 and 7 must be set on all HCE devices, indicating TA(1), TB(1)
+and TC(1) are included in the ATS response. Bits 1 to 4 indicate the FSCI,
+coding the maximum frame size. On HCE devices the value of FSCI must be
between 0h and 8h.</li>
-<li>T(A)1: defines bitrates between reader and emulator, and whether they can be
+<li>T(A)1: defines bitrates between reader and emulator, and whether they can be
asymmetric. There are no bitrate requirements or guarantees for HCE devices.</li>
-<li>T(B)1: bits 1 to 4 indicate the Start-up Frame Guard time Integer (SFGI). On
-HCE devices, SFGI must be &lt;= 8h. Bits 5 to 8 indicate the Frame Waiting time
-Integer (FWI) and codes the Frame Waiting Time (FWT). On HCE devices, FWI must
+<li>T(B)1: bits 1 to 4 indicate the Start-up Frame Guard time Integer (SFGI). On
+HCE devices, SFGI must be &lt;= 8h. Bits 5 to 8 indicate the Frame Waiting time
+Integer (FWI) and codes the Frame Waiting Time (FWT). On HCE devices, FWI must
be &lt;= 8h.</li>
-<li>T(C)1: bit 5 indicates support for "Advanced Protocol features". HCE devices
-may or may not support "Advanced Protocol features". Bit 2 indicates support
-for DID. HCE devices may or may not support DID. Bit 1 indicates support for
+<li>T(C)1: bit 5 indicates support for "Advanced Protocol features". HCE devices
+may or may not support "Advanced Protocol features". Bit 2 indicates support
+for DID. HCE devices may or may not support DID. Bit 1 indicates support for
NAD. HCE devices must not support NAD and set bit 1 to zero.</li>
-<li>Historical bytes: HCE devices may return up to 15 historical bytes. NFC
-readers willing to interact with HCE services should make no assumptions about
+<li>Historical bytes: HCE devices may return up to 15 historical bytes. NFC
+readers willing to interact with HCE services should make no assumptions about
the contents of the historical bytes or their presence.</li>
</ul>
-<p>Note that many HCE devices are likely made compliant with protocol requirements
-that the payment networks united in EMVCo have specified in their "Contactless
+<p>Note that many HCE devices are likely made compliant with protocol requirements
+that the payment networks united in EMVCo have specified in their "Contactless
Communication Protocol" specification. In particular:</p>
<ul>
<li>FSCI in T0 must be between 2h and 8h.</li>
-<li>T(A)1 must be set to 0x80, indicating only the 106 kbit/s bitrate is
-supported, and asymmetric bitrates between reader and emulator are not
+<li>T(A)1 must be set to 0x80, indicating only the 106 kbit/s bitrate is
+supported, and asymmetric bitrates between reader and emulator are not
supported.</li>
<li>FWI in T(B)1 must be &lt;= 7h.</li>
</ul>
<h3 id="ApduExchange">APDU data exchange</h3>
-<p>As noted earlier, HCE implementations only support a single logical channel.
-Attempting to select applications on different logical channels will not work on
+<p>As noted earlier, HCE implementations only support a single logical channel.
+Attempting to select applications on different logical channels will not work on
a HCE device.</p>
diff --git a/docs/html/guide/topics/manifest/manifest-intro.jd b/docs/html/guide/topics/manifest/manifest-intro.jd
index d25a513..76fe2a2 100644
--- a/docs/html/guide/topics/manifest/manifest-intro.jd
+++ b/docs/html/guide/topics/manifest/manifest-intro.jd
@@ -1,4 +1,4 @@
-page.title=The AndroidManifest.xml File
+page.title=App Manifest
@jd:body
<div id="qv-wrapper">
diff --git a/docs/html/guide/topics/security/permissions.jd b/docs/html/guide/topics/security/permissions.jd
index 4ad9b7c..6f919da 100644
--- a/docs/html/guide/topics/security/permissions.jd
+++ b/docs/html/guide/topics/security/permissions.jd
@@ -1,4 +1,4 @@
-page.title=Permissions
+page.title=System Permissions
@jd:body
<div id="qv-wrapper">
@@ -20,10 +20,6 @@ page.title=Permissions
</ol>
</div>
</div>
-<p>This document describes how application developers can use the
-security features provided by Android. A more general <a
-href="http://source.android.com/tech/security/index.html"> Android Security
-Overview</a> is provided in the Android Open Source Project.</p>
<p>Android is a privilege-separated operating system, in which each
application runs with a distinct system identity (Linux user ID and group
@@ -33,7 +29,13 @@ Linux thereby isolates applications from each other and from the system.</p>
<p>Additional finer-grained security features are provided through a
"permission" mechanism that enforces restrictions on the specific operations
that a particular process can perform, and per-URI permissions for granting
-ad-hoc access to specific pieces of data.</p>
+ad hoc access to specific pieces of data.</p>
+
+<p>This document describes how application developers can use the
+security features provided by Android. A more general <a
+href="http://source.android.com/tech/security/index.html"> Android Security
+Overview</a> is provided in the Android Open Source Project.</p>
+
<a name="arch"></a>
<h2>Security Architecture</h2>
@@ -42,10 +44,10 @@ ad-hoc access to specific pieces of data.</p>
application, by default, has permission to perform any operations that would
adversely impact other applications, the operating system, or the user. This
includes reading or writing the user's private data (such as contacts or
-e-mails), reading or writing another application's files, performing
-network access, keeping the device awake, etc.</p>
+emails), reading or writing another application's files, performing
+network access, keeping the device awake, and so on.</p>
-<p>Because Android sandboxes applications from each other, applications
+<p>Because each Android application operates in a process sandbox, applications
must explicitly share resources and data. They do this by declaring the
<em>permissions</em> they need for additional capabilities not provided by
the basic sandbox. Applications statically declare the permissions they
@@ -65,10 +67,10 @@ other.</p>
<a name="signing"></a>
<h2>Application Signing</h2>
-<p>All Android applications (.apk files) must be signed with a certificate
+<p>All APKs ({@code .apk} files) must be signed with a certificate
whose private key is held by their developer. This certificate identifies
the author of the application. The certificate does <em>not</em> need to be
-signed by a certificate authority: it is perfectly allowable, and typical,
+signed by a certificate authority; it is perfectly allowable, and typical,
for Android applications to use self-signed certificates. The purpose of
certificates in Android is to distinguish application authors. This allows
the system to grant or deny applications access to <a
@@ -86,7 +88,7 @@ device. On a different device, the same package may have a different UID;
what matters is that each package has a distinct UID on a given device.</p>
<p>Because security enforcement happens at the
-process level, the code of any two packages can not normally
+process level, the code of any two packages cannot normally
run in the same process, since they need to run as different Linux users.
You can use the {@link android.R.attr#sharedUserId} attribute in the
<code>AndroidManifest.xml</code>'s
@@ -114,7 +116,7 @@ been set appropriately so any other application can see it.</p>
<h2>Using Permissions</h2>
<p>A basic Android application has no permissions associated with it by default,
-meaning it can not do anything that would adversely impact the user experience
+meaning it cannot do anything that would adversely impact the user experience
or any data on the device. To make use of protected features of the device,
you must include in your <code>AndroidManifest.xml</code> one or more
<code>{@link android.R.styleable#AndroidManifestUsesPermission &lt;uses-permission&gt;}</code>
@@ -133,9 +135,9 @@ specify:</p>
granted to it by the package installer, based on checks against the
signatures of the applications declaring those permissions and/or interaction
with the user. <em>No</em> checks with the user
-are done while an application is running: it either was granted a particular
+are done while an application is running; the app is either granted a particular
permission when installed, and can use that feature as desired, or the
-permission was not granted and any attempt to use the feature will fail
+permission is not granted and any attempt to use the feature fails
without prompting the user.</p>
<p>Often times a permission failure will result in a {@link
@@ -146,6 +148,12 @@ being delivered to each receiver, after the method call has returned, so you
will not receive an exception if there are permission failures. In almost all
cases, however, a permission failure will be printed to the system log.</p>
+<p>However, in a normal user situation (such as when the app is installed
+from Google Play Store), an app cannot be installed if the user does not grant the app
+each of the requested permissions. So you generally don't need to worry about runtime failures
+caused by missing permissions because the mere fact that the app is installed at all
+means that your app has been granted its desired permissions.</p>
+
<p>The permissions provided by the Android system can be found at {@link
android.Manifest.permission}. Any application may also define and enforce its
own permissions, so this is not a comprehensive list of all possible
@@ -433,3 +441,37 @@ android:grantUriPermissions} attribute or
{@link android.content.Context#checkUriPermission Context.checkUriPermission()}
methods.</p>
+
+
+
+
+<div class="next-docs">
+<div class="col-6">
+ <h2 class="norule">Continue reading about:</h2>
+ <dl>
+ <dt><a href="{@docRoot}guide/topics/manifest/uses-feature-element.html#permissions"
+ >Permissions that Imply Feature Requirements</a></dt>
+ <dd>Information about how requesting some permissions will implicitly restrict your app
+ to devices that include the corresponding hardware or software feature.</dd>
+ <dt><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">{@code
+ &lt;uses-permission>}</a></dt>
+ <dd>API reference for the manifest tag that declare's your app's required system permissions.
+ </dd>
+ <dt>{@link android.Manifest.permission}</dt>
+ <dd>API reference for all system permissions.</dd>
+ </dl>
+</div>
+<div class="col-6">
+ <h2 class="norule">You might also be interested in:</h2>
+ <dl>
+ <dt><a href="{@docRoot}guide/practices/compatibility.html"
+ >Device Compatibility</a></dt>
+ <dd>Information about Android works on different types of devices and an introduction
+ to how you can optimize your app for each device or restrict your app's availability
+ to different devices.</dd>
+ <dt><a href="{@docRoot}http://source.android.com/devices/tech/security/index.html"
+ class="external-link">Android Security Overview</a></dt>
+ <dd>A detailed discussion about the Android platform's security model.</dd>
+ </dl>
+</div>
+</div>
diff --git a/docs/html/training/best-ui.jd b/docs/html/training/best-ui.jd
new file mode 100644
index 0000000..bf0d7ee
--- /dev/null
+++ b/docs/html/training/best-ui.jd
@@ -0,0 +1,11 @@
+page.title=Best Practices for User Interface
+page.trainingcourse=true
+
+@jd:body
+
+
+
+<p>These classes teach you how to build a user interface using Android layouts for all types of
+devices. Android provides a flexible framework for UI design that allows your app to display
+different layouts for different devices, create custom UI widgets, and even control aspects
+of the system UI outside your app's window.</p>
diff --git a/docs/html/training/best-ux.jd b/docs/html/training/best-ux.jd
index 5f109f6..129535b 100644
--- a/docs/html/training/best-ux.jd
+++ b/docs/html/training/best-ux.jd
@@ -1,12 +1,13 @@
-page.title=Best Practices for User Experience &amp; UI
+page.title=Best Practices for Interaction and Engagement
page.trainingcourse=true
@jd:body
-<p>These classes focus on the best Android user experience for your app.
-In some cases, the success of your app on Android is heavily
-affected by whether your app conforms to the user's expectations for
-UI and navigation on an Android device. Follow these recommendations to ensure that
-your app looks and behaves in a way that satisfies Android users.</p> \ No newline at end of file
+<p>These classes teach you how to engage and retain your users by implementing
+the best interaction patterns for Android. For instance, to help users quickly discover content
+in your app, your app should match their expectations for user interaction on Android.
+And to keep your users coming back, you should take advantage of
+platform capabilities that reveal and open your content without
+requiring users to go through the app launcher.</p>
diff --git a/docs/html/training/system-ui/navigation.jd b/docs/html/training/system-ui/navigation.jd
index 3907bb2..1c73c70 100644
--- a/docs/html/training/system-ui/navigation.jd
+++ b/docs/html/training/system-ui/navigation.jd
@@ -63,6 +63,9 @@ user experience. </p>
the navigation bar and the status bar:</p>
<pre>View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
+// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
+// a general rule, you should design your app to hide the status bar whenever you
+// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);</pre>
diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs
index d28f37b..c4b9a7a 100644
--- a/docs/html/training/training_toc.cs
+++ b/docs/html/training/training_toc.cs
@@ -705,7 +705,7 @@ include the action bar on devices running Android 2.1 or higher."
<div class="nav-section-header">
<a href="<?cs var:toroot ?>training/best-ux.html">
<span class="small">Best Practices for</span><br/>
- User Experience &amp; UI
+ Interaction &amp; Engagement
</a>
</div>
<ul>
@@ -835,6 +835,42 @@ include the action bar on devices running Android 2.1 or higher."
</ul>
</li>
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/app-indexing/index.html"
+ description=
+ "How to enable deep linking and indexing of your application
+content so that users can open this content directly from their mobile search
+results."
+ >Making Your App Content Searchable</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/app-indexing/deep-linking.html">
+ Enabling Deep Links for App Content
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/app-indexing/enabling-app-indexing.html">
+ Specifying App Content for Indexing
+ </a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <!-- End Interaction and Engagement -->
+
+
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/best-ui.html">
+ <span class="small">Best Practices for</span><br/>
+ User Interface
+ </a>
+ </div>
+ <ul>
+
<li class="nav-section">
<div class="nav-section-header">
@@ -1001,30 +1037,11 @@ include the action bar on devices running Android 2.1 or higher."
</ul>
</li>
- <li class="nav-section">
- <div class="nav-section-header">
- <a href="<?cs var:toroot ?>training/app-indexing/index.html"
- description=
- "How to enable deep linking and indexing of your application
-content so that users can open this content directly from their mobile search
-results."
- >Making Your App Content Searchable</a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/app-indexing/deep-linking.html">
- Enabling Deep Links for App Content
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/app-indexing/enabling-app-indexing.html">
- Specifying App Content for Indexing
- </a>
- </li>
- </ul>
- </li>
-
</ul>
</li>
- <!-- End best UX and UI -->
+ <!-- End User Interface -->
+
+
<li class="nav-section">