summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/html/guide/google/gcm/gcm.jd8
-rw-r--r--docs/html/guide/practices/security.jd4
-rw-r--r--docs/html/guide/topics/manifest/provider-element.jd161
-rw-r--r--docs/html/guide/topics/providers/content-provider-basics.jd147
4 files changed, 170 insertions, 150 deletions
diff --git a/docs/html/guide/google/gcm/gcm.jd b/docs/html/guide/google/gcm/gcm.jd
index 5515f31..72c3f23 100644
--- a/docs/html/guide/google/gcm/gcm.jd
+++ b/docs/html/guide/google/gcm/gcm.jd
@@ -653,8 +653,10 @@ message sent by the application server. See <a href="adv.html#collapsible">Advan
<td><code>data</code></td>
<td>A JSON object whose fields represents the key-value pairs of the message's payload data. If present, the payload data it will be
included in the Intent as application data, with the key being the extra's name. For instance, <code>"data":{"score":"3x1"}</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>.
+
There is no limit on the number of key/value pairs, though there is a limit on the total size of the message (4kb). The values could be any JSON object, but we recommend using strings, since the values will be converted to strings in the GCM server anyway. If you want to include objects or other non-string data types (such as integers or booleans), you have to do the conversion to string yourself. Also note that the key cannot be a reserved word (<code>from</code> or any word starting with <code>google.</code>). To complicate things slightly, there are some reserved words (such as <code>collapse_key</code>) that are technically allowed in payload data. However, if the request also contains the word, the value in the request will overwrite the value in the payload data. Hence using words that are defined as field names in this table is not recommended, even in cases where they are technically allowed. Optional.</td>
+
</tr>
<tr>
<td><code>delay_while_idle</code></td>
@@ -685,8 +687,10 @@ sent. Optional. The default value is <code>false</code>, and must be a JSON bool
</tr>
<tr>
<td><code>data.&lt;key&gt;</code></td>
+
<td>Payload data, expressed as parameters prefixed with <code>data.</code> and suffixed as the key. For instance, a parameter of <code>data.score=3x1</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. There is no limit on the number of key/value parameters, though there is a limit on the total size of the message. Also note that the key cannot be a reserved word (<code>from</code> or any word starting with
<code>google.</code>). To complicate things slightly, there are some reserved words (such as <code>collapse_key</code>) that are technically allowed in payload data. However, if the request also contains the word, the value in the request will overwrite the value in the payload data. Hence using words that are defined as field names in this table is not recommended, even in cases where they are technically allowed. Optional.</td>
+
</tr>
<tr>
<td><code>delay_while_idle</code></td>
@@ -698,7 +702,7 @@ sent. Optional. The default value is <code>false</code>, and must be a JSON bool
</tr>
</table>
-<p>If you want to test your request (either JSON or plain text) without delivering the message to the devices, you can set an optional HTTP parameter called <code>dry_run</code> with the value <code>true</code>. The result will be almost identical to running the request without this parameter, except that the message will not be delivered to the devices. Consequently, the response will contain fake IDs for the message and multicast fields (see <a href="#response">Response format</a>).</p>
+
<h4 id="example-requests">Example requests</h4>
<p>Here is the smallest possible request (a message without any parameters and just one recipient) using JSON:</p>
@@ -891,13 +895,11 @@ Happens when the error code is <code>InvalidDataKey</code>.</dd>
</ul>
Check that the token you're sending inside the <code>Authorization</code> header is the correct API key associated with your project. You can check the validity of your API key by running the following command:<br/>
-
<pre># api_key=YOUR_API_KEY
# curl --header "Authorization: key=$api_key" --header Content-Type:"application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"ABC\"]}"</pre>
-
If you receive a 401 HTTP status code, your API key is not valid. Otherwise you should see something like this:<br/>
<pre>
diff --git a/docs/html/guide/practices/security.jd b/docs/html/guide/practices/security.jd
index ce59a9d..36eeff8 100644
--- a/docs/html/guide/practices/security.jd
+++ b/docs/html/guide/practices/security.jd
@@ -1,11 +1,11 @@
-page.title=Designing for Security
+page.title=Designing for Security
@jd:body
<div id="qv-wrapper">
<div id="qv">
<h2>In this document</h2>
<ol>
-<li><a href="#Dalvik">Using Davlik Code</a></li>
+<li><a href="#Dalvik">Using Dalvik Code</a></li>
<li><a href="#Native">Using Native Code</a></li>
<li><a href="#Data">Storing Data</a></li>
<li><a href="#IPC">Using IPC</a></li>
diff --git a/docs/html/guide/topics/manifest/provider-element.jd b/docs/html/guide/topics/manifest/provider-element.jd
index 4558800..6cf6843 100644
--- a/docs/html/guide/topics/manifest/provider-element.jd
+++ b/docs/html/guide/topics/manifest/provider-element.jd
@@ -5,7 +5,9 @@ parent.link=manifest-intro.html
<dl class="xml">
<dt>syntax:</dt>
-<dd><pre class="stx">&lt;provider android:<a href="#auth">authorities</a>="<i>list</i>"
+<dd>
+<pre class="stx">
+&lt;provider android:<a href="#auth">authorities</a>="<i>list</i>"
android:<a href="#enabled">enabled</a>=["true" | "false"]
android:<a href="#exported">exported</a>=["true" | "false"]
android:<a href="#gprmsn">grantUriPermissions</a>=["true" | "false"]
@@ -20,10 +22,13 @@ parent.link=manifest-intro.html
android:<a href="#sync">syncable</a>=["true" | "false"]
android:<a href="#wprmsn">writePermission</a>="<i>string</i>" &gt;
. . .
-&lt;/provider&gt;</pre></dd>
+&lt;/provider&gt;</pre>
+</dd>
<dt>contained in:</dt>
-<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code></dd>
+<dd>
+ <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+</dd>
<dt>can contain:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html">&lt;meta-data&gt;</a></code>
@@ -31,58 +36,67 @@ parent.link=manifest-intro.html
<br/><code><a href="{@docRoot}guide/topics/manifest/path-permission-element.html">&lt;path-permission&gt;</a></code></dd>
<dt>description:</dt>
-<dd>Declares a content provider &mdash; a subclass of
-{@link android.content.ContentProvider} &mdash; that supplies structured
-access to data managed by the application. All content providers that
-are part of the application must be represented by {@code &lt;provider&gt;}
-elements in the manifest file. The system cannot see, and therefore will
-not run, any that are not declared. (You need to declare only
-those content providers that you develop as part of your application,
-not those developed by others that your application uses.)
-
-<p>
-The Android system identifies content providers by the authority part
- of a {@code content:} URI. For example, suppose that the following URI
-is passed to <code>{@link android.content.ContentResolver#query
-ContentResolver.query()}</code>:
-
-<p style="margin-left: 2em">{@code content://com.example.project.healthcareprovider/nurses/rn}</p>
-
-<p>
-The {@code content:} scheme identifies the data as belonging to a content
-provider and the authority ({@code com.example.project.healthcareprovider})
-identifies the particular provider. The authority therefore must be unique.
-Typically, as in this example, it's the fully qualified name of a
-ContentProvider subclass. The path part of a URI may be used by a content
-provider to identify particular data subsets, but those paths are not
-declared in the manifest.
-</p>
-
-<p>
-For information on using and developing content providers, see a separate document,
-<a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.
-</p></dd>
+<dd>
+ Declares a content provider component. A content provider is a subclass of
+ {@link android.content.ContentProvider} that supplies structured access to data managed by the
+ application. All content providers in your application must be defined in a
+ {@code &lt;provider&gt;} element in the manifest file; otherwise, the system is unaware of them
+ and doesn't run them.
+ <p>
+ You only declare content providers that are part of your application. Content providers in
+ other applications that you use in your application should not be declared.
+ </p>
+ <p>
+ The Android system stores references to content providers according to an <b>authority</b>
+ string, part of the provider's <b>content URI</b>. For example, suppose you want to
+ access a content provider that stores information about health care professionals. To do
+ this, you call the method
+ {@link android.content.ContentResolver#query ContentResolver.query()}, which among other
+ arguments takes a URI that identifies the provider:
+ </p>
+<pre>
+content://com.example.project.healthcareprovider/nurses/rn
+</pre>
+ <p>
+ The <code>content:</code> <b>scheme</b> identifies the URI as a content URI pointing to
+ an Android content provider. The authority
+ <code>com.example.project.healthcareprovider</code> identifies the provider itself; the
+ Android system looks up the authority in its list of known providers and their authorities.
+ The substring <code>nurses/rn</code> is a <b>path</b>, which the content provider can use
+ to identify subsets of the provider data.
+ </p>
+ <p>
+ Notice that when you define your provider in the <code>&lt;provider&gt;</code> element, you
+ don't include the scheme or the path in the <code>android:name</code> argument, only the
+ authority.
+ </p>
+ <p>
+ For information on using and developing content providers, see the API Guide,
+ <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.
+ </p>
+</dd>
<dt>attributes:</dt>
-<dd><dl class="attr">
-<dt><a name="auth"></a>{@code android:authorities}</dt>
-<dd>A list of one or more URI authorities that identify data under the purview
-of the content provider.
-Multiple authorities are listed by separating their names with a semicolon.
-To avoid conflicts, authority names should use a Java-style naming convention
-(such as {@code com.example.provider.cartoonprovider}). Typically, it's the name
-of the ContentProvider subclass.
-
-<p>
-There is no default. At least one authority must be specified.
-</p></dd>
-
-<dt><a name="enabled"></a>{@code android:enabled}</dt>
-<dd>Whether or not the content provider can be instantiated by the system &mdash;
-"{@code true}" if it can be, and "{@code false}" if not. The default value
-is "{@code true}".
-
-<p>
+<dd>
+ <dl class="attr">
+ <dt><a name="auth"></a>{@code android:authorities}</dt>
+ <dd>
+ A list of one or more URI authorities that identify data offered by the content provider.
+ Multiple authorities are listed by separating their names with a semicolon.
+ To avoid conflicts, authority names should use a Java-style naming convention
+ (such as {@code com.example.provider.cartoonprovider}). Typically, it's the name
+ of the {@link android.content.ContentProvider} subclass that implements the provider
+ <p>
+ There is no default. At least one authority must be specified.
+ </p>
+ </dd>
+
+ <dt><a name="enabled"></a>{@code android:enabled}</dt>
+ <dd>Whether or not the content provider can be instantiated by the system &mdash;
+ "{@code true}" if it can be, and "{@code false}" if not. The default value
+ is "{@code true}".
+
+ <p>
The <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element has its own
<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
application components, including content providers. The
@@ -93,16 +107,37 @@ are by default) for the content provider to be enabled. If either is
</p></dd>
<dt><a name="exported"></a>{@code android:exported}</dt>
-<dd>Whether or not the content provider can be used by components of other
-applications &mdash; "{@code true}" if it can be, and "{@code false}" if not.
-If "{@code false}", the provider is available only to components of the
-same application or applications with the same user ID. The default value
-is "{@code true}".
-
-<p>
-You can export a content provider but still limit access to it with the
-<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">permission</a></code> attribute.
-</p></dd>
+<dd>
+ Whether the content provider is available for other applications to use:
+ <ul>
+ <li>
+ <code>true</code>: The provider is available to other applications. Any application can
+ use the provider's content URI to access it, subject to the permissions specified for
+ the provider.
+ </li>
+ <li>
+ <code>false</code>: The provider is not available to other applications. Set
+ <code>android:exported="false"</code> to limit access to the provider to your
+ applications. Only applications that have the same user ID (UID) as the provider will
+ have access to it.
+ </li>
+ </ul>
+ <p>
+ The default value is <code>"true"</code> for applications that set either
+<code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">android:minSdkVersion</a></code>
+ or
+<code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">android:targetSdkVersion</a></code> to
+ <code>"16"</code> or lower. For applications that
+ set either of these attributes to <code>"17"</code> or higher, the default is
+ <code>"false"</code>.
+ </p>
+ <p>
+ You can set <code>android:exported="false"</code> and still limit access to your
+ provider by setting permissions with the
+ <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">permission</a></code>
+ attribute.
+ </p>
+</dd>
<dt><a name="gprmsn"></a>{@code android:grantUriPermissions}</dt>
<dd>Whether or not those who ordinarily would not have permission to
diff --git a/docs/html/guide/topics/providers/content-provider-basics.jd b/docs/html/guide/topics/providers/content-provider-basics.jd
index 8c47ad7..527e713 100644
--- a/docs/html/guide/topics/providers/content-provider-basics.jd
+++ b/docs/html/guide/topics/providers/content-provider-basics.jd
@@ -2,9 +2,7 @@ page.title=Content Provider Basics
@jd:body
<div id="qv-wrapper">
<div id="qv">
-
-
- <!-- In this document -->
+<!-- In this document -->
<h2>In this document</h2>
<ol>
<li>
@@ -238,15 +236,11 @@ page.title=Content Provider Basics
</p>
<p>
For example, to get a list of the words and their locales from the User Dictionary Provider,
- you call {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
- ContentResolver.query()}.
- The {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
- query()} method calls the
- {@link android.content.ContentProvider#query(Uri, String[], String, String[], String)
- ContentProvider.query()} method defined by the User Dictionary Provider. The following lines
- of code show a
- {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
- ContentResolver.query()} call:
+ you call {@link android.content.ContentResolver#query ContentResolver.query()}.
+ The {@link android.content.ContentResolver#query query()} method calls the
+ {@link android.content.ContentProvider#query ContentProvider.query()} method defined by the
+ User Dictionary Provider. The following lines of code show a
+ {@link android.content.ContentResolver#query ContentResolver.query()} call:
<p>
<pre>
// Queries the user dictionary and returns results
@@ -259,7 +253,7 @@ mCursor = getContentResolver().query(
</pre>
<p>
Table 2 shows how the arguments to
- {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
+ {@link android.content.ContentResolver#query
query(Uri,projection,selection,selectionArgs,sortOrder)} match an SQL SELECT statement:
</p>
<p class="table-caption">
@@ -344,7 +338,7 @@ content://user_dictionary/words
<code>4</code> from user dictionary, you can use this content URI:
</p>
<pre>
-Uri singleUri = ContentUri.withAppendedId(UserDictionary.Words.CONTENT_URI,4);
+Uri singleUri = ContentUris.withAppendedId(UserDictionary.Words.CONTENT_URI,4);
</pre>
<p>
You often use id values when you've retrieved a set of rows and then want to update or delete
@@ -354,7 +348,7 @@ Uri singleUri = ContentUri.withAppendedId(UserDictionary.Words.CONTENT_URI,4);
<strong>Note:</strong> The {@link android.net.Uri} and {@link android.net.Uri.Builder} classes
contain convenience methods for constructing well-formed Uri objects from strings. The
{@link android.content.ContentUris} contains convenience methods for appending id values to
- a URI. The previous snippet uses {@link android.content.ContentUris#withAppendedId(Uri, long)
+ a URI. The previous snippet uses {@link android.content.ContentUris#withAppendedId
withAppendedId()} to append an id to the UserDictionary content URI.
</p>
@@ -367,10 +361,9 @@ Uri singleUri = ContentUri.withAppendedId(UserDictionary.Words.CONTENT_URI,4);
</p>
<p class="note">
For the sake of clarity, the code snippets in this section call
- {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
- ContentResolver.query()} on the "UI thread"". In actual code, however, you should
- do queries asynchronously on a separate thread. One way to do this is to use the
- {@link android.content.CursorLoader} class, which is described
+ {@link android.content.ContentResolver#query ContentResolver.query()} on the "UI thread"". In
+ actual code, however, you should do queries asynchronously on a separate thread. One way to do
+ this is to use the {@link android.content.CursorLoader} class, which is described
in more detail in the <a href="{@docRoot}guide/components/loaders.html">
Loaders</a> guide. Also, the lines of code are snippets only; they don't show a complete
application.
@@ -391,8 +384,8 @@ Uri singleUri = ContentUri.withAppendedId(UserDictionary.Words.CONTENT_URI,4);
To retrieve data from a provider, your application needs "read access permission" for the
provider. You can't request this permission at run-time; instead, you have to specify that
you need this permission in your manifest, using the
- <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
- &lt;uses-permission&gt;</a></code> element and the exact permission name defined by the
+<code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code>
+ element and the exact permission name defined by the
provider. When you specify this element in your manifest, you are in effect "requesting" this
permission for your application. When users install your application, they implicitly grant
this request.
@@ -436,10 +429,9 @@ String[] mSelectionArgs = {""};
</pre>
<p>
The next snippet shows how to use
- {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
- ContentResolver.query()}, using the User Dictionary Provider as an example.
- A provider client query is similar to an SQL query, and it contains a set of columns to return,
- a set of selection criteria, and a sort order.
+ {@link android.content.ContentResolver#query ContentResolver.query()}, using the User Dictionary
+ Provider as an example. A provider client query is similar to an SQL query, and it contains a
+ set of columns to return, a set of selection criteria, and a sort order.
</p>
<p>
The set of columns that the query should return is called a <strong>projection</strong>
@@ -448,9 +440,9 @@ String[] mSelectionArgs = {""};
<p>
The expression that specifies the rows to retrieve is split into a selection clause and
selection arguments. The selection clause is a combination of logical and Boolean expressions,
- column names, and values (the variable <code>mSelection</code>). If you specify the replaceable
- parameter <code>?</code> instead of a value, the query method retrieves the value from the
- selection arguments array (the variable <code>mSelectionArgs</code>).
+ column names, and values (the variable <code>mSelectionClause</code>). If you specify the
+ replaceable parameter <code>?</code> instead of a value, the query method retrieves the value
+ from the selection arguments array (the variable <code>mSelectionArgs</code>).
</p>
<p>
In the next snippet, if the user doesn't enter a word, the selection clause is set to
@@ -517,7 +509,7 @@ if (null == mCursor) {
This query is analogous to the SQL statement:
</p>
<pre>
-SELECT _ID, word, frequency, locale FROM words WHERE word = &lt;userinput&gt; ORDER BY word ASC;
+SELECT _ID, word, locale FROM words WHERE word = &lt;userinput&gt; ORDER BY word ASC;
</pre>
<p>
In this SQL statement, the actual column names are used instead of contract class constants.
@@ -575,16 +567,15 @@ selectionArgs[0] = mUserInput;
<!-- Displaying the results -->
<h3 id="DisplayResults">Displaying query results</h3>
<p>
- The {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
- ContentResolver.query()} client method always returns a {@link android.database.Cursor}
- containing the columns specified by the query's projection for the rows that match the query's
- selection criteria. A {@link android.database.Cursor} object provides random read access to the
- rows and columns it contains. Using {@link android.database.Cursor} methods,
- you can iterate over the rows in the results, determine the data type of each column, get the
- data out of a column, and examine other properties of the results. Some
- {@link android.database.Cursor} implementations automatically update the object when the
- provider's data changes, or trigger methods in an observer object when the
- {@link android.database.Cursor} changes, or both.
+ The {@link android.content.ContentResolver#query ContentResolver.query()} client method always
+ returns a {@link android.database.Cursor} containing the columns specified by the query's
+ projection for the rows that match the query's selection criteria. A
+ {@link android.database.Cursor} object provides random read access to the rows and columns it
+ contains. Using {@link android.database.Cursor} methods, you can iterate over the rows in the
+ results, determine the data type of each column, get the data out of a column, and examine other
+ properties of the results. Some {@link android.database.Cursor} implementations automatically
+ update the object when the provider's data changes, or trigger methods in an observer object
+ when the {@link android.database.Cursor} changes, or both.
</p>
<p class="note">
<strong>Note:</strong> A provider may restrict access to columns based on the nature of the
@@ -594,7 +585,7 @@ selectionArgs[0] = mUserInput;
<p>
If no rows match the selection criteria, the provider
returns a {@link android.database.Cursor} object for which
- {@link android.database.Cursor#getCount() Cursor.getCount()} is 0 (an empty cursor).
+ {@link android.database.Cursor#getCount Cursor.getCount()} is 0 (an empty cursor).
</p>
<p>
If an internal error occurs, the results of the query depend on the particular provider. It may
@@ -685,8 +676,8 @@ if (mCursor != null) {
<p>
{@link android.database.Cursor} implementations contain several "get" methods for
retrieving different types of data from the object. For example, the previous snippet
- uses {@link android.database.Cursor#getString(int) getString()}. They also have a
- {@link android.database.Cursor#getType(int) getType()} method that returns a value indicating
+ uses {@link android.database.Cursor#getString getString()}. They also have a
+ {@link android.database.Cursor#getType getType()} method that returns a value indicating
the data type of the column.
</p>
@@ -713,17 +704,16 @@ if (mCursor != null) {
</p>
<p>
To get the permissions needed to access a provider, an application requests them with a
- <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
- &lt;uses-permission&gt;</a></code> element in its manifest file.
- When the Android Package Manager installs the application, a user must approve all of the
- permissions the application requests. If the user approves all of them, Package Manager
- continues the installation; if the user doesn't approve them, Package Manager
+<code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code>
+ element in its manifest file. When the Android Package Manager installs the application, a user
+ must approve all of the permissions the application requests. If the user approves all of them,
+ Package Manager continues the installation; if the user doesn't approve them, Package Manager
aborts the installation.
</p>
<p>
The following
- <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
- &lt;uses-permission&gt;</a></code> element requests read access to the User Dictionary Provider:
+<code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code>
+ element requests read access to the User Dictionary Provider:
</p>
<pre>
&lt;uses-permission android:name="android.permission.READ_USER_DICTIONARY"&gt;
@@ -746,7 +736,7 @@ if (mCursor != null) {
<h3 id="Inserting">Inserting data</h3>
<p>
To insert data into a provider, you call the
- {@link android.content.ContentResolver#insert(Uri,ContentValues) ContentResolver.insert()}
+ {@link android.content.ContentResolver#insert ContentResolver.insert()}
method. This method inserts a new row into the provider and returns a content URI for that row.
This snippet shows how to insert a new word into the User Dictionary Provider:
</p>
@@ -777,8 +767,7 @@ mNewUri = getContentResolver().insert(
The data for the new row goes into a single {@link android.content.ContentValues} object, which
is similar in form to a one-row cursor. The columns in this object don't need to have the
same data type, and if you don't want to specify a value at all, you can set a column
- to <code>null</code> using {@link android.content.ContentValues#putNull(String)
- ContentValues.putNull()}.
+ to <code>null</code> using {@link android.content.ContentValues#putNull ContentValues.putNull()}.
</p>
<p>
The snippet doesn't add the <code>_ID</code> column, because this column is maintained
@@ -799,17 +788,16 @@ content://user_dictionary/words/&lt;id_value&gt;
</p>
<p>
To get the value of <code>_ID</code> from the returned {@link android.net.Uri}, call
- {@link android.content.ContentUris#parseId(Uri) ContentUris.parseId()}.
+ {@link android.content.ContentUris#parseId ContentUris.parseId()}.
</p>
<h3 id="Updating">Updating data</h3>
<p>
To update a row, you use a {@link android.content.ContentValues} object with the updated
values just as you do with an insertion, and selection criteria just as you do with a query.
The client method you use is
- {@link android.content.ContentResolver#update(Uri, ContentValues, String, String[])
- ContentResolver.update()}. You only need to add values to the
- {@link android.content.ContentValues} object for columns you're updating. If you want to clear
- the contents of a column, set the value to <code>null</code>.
+ {@link android.content.ContentResolver#update ContentResolver.update()}. You only need to add
+ values to the {@link android.content.ContentValues} object for columns you're updating. If you
+ want to clear the contents of a column, set the value to <code>null</code>.
</p>
<p>
The following snippet changes all the rows whose locale has the language "en" to a
@@ -842,9 +830,8 @@ mRowsUpdated = getContentResolver().update(
</pre>
<p>
You should also sanitize user input when you call
- {@link android.content.ContentResolver#update(Uri, ContentValues, String, String[])
- ContentResolver.update()}. To learn more about this, read the section
- <a href="#Injection">Protecting against malicious input</a>.
+ {@link android.content.ContentResolver#update ContentResolver.update()}. To learn more about
+ this, read the section <a href="#Injection">Protecting against malicious input</a>.
</p>
<h3 id="Deleting">Deleting data</h3>
<p>
@@ -873,9 +860,8 @@ mRowsDeleted = getContentResolver().delete(
</pre>
<p>
You should also sanitize user input when you call
- {@link android.content.ContentResolver#delete(Uri, String, String[])
- ContentResolver.delete()}. To learn more about this, read the section
- <a href="#Injection">Protecting against malicious input</a>.
+ {@link android.content.ContentResolver#delete ContentResolver.delete()}. To learn more about
+ this, read the section <a href="#Injection">Protecting against malicious input</a>.
</p>
<!-- Provider Data Types -->
<h2 id="DataTypes">Provider Data Types</h2>
@@ -907,7 +893,7 @@ mRowsDeleted = getContentResolver().delete(
The data types for the User Dictionary Provider are listed in the reference documentation
for its contract class {@link android.provider.UserDictionary.Words} (contract classes are
described in the section <a href="#ContractClasses">Contract Classes</a>).
- You can also determine the data type by calling {@link android.database.Cursor#getType(int)
+ You can also determine the data type by calling {@link android.database.Cursor#getType
Cursor.getType()}.
</p>
<p>
@@ -918,7 +904,7 @@ mRowsDeleted = getContentResolver().delete(
data structures or files. For example, the {@link android.provider.ContactsContract.Data}
table in the Contacts Provider uses MIME types to label the type of contact data stored in each
row. To get the MIME type corresponding to a content URI, call
- {@link android.content.ContentResolver#getType(Uri) ContentResolver.getType()}.
+ {@link android.content.ContentResolver#getType ContentResolver.getType()}.
</p>
<p>
The section <a href="#MIMETypeReference">MIME Type Reference</a> describes the
@@ -935,8 +921,7 @@ mRowsDeleted = getContentResolver().delete(
<li>
<a href="#Batch">Batch access</a>: You can create a batch of access calls with methods in
the {@link android.content.ContentProviderOperation} class, and then apply them with
- {@link android.content.ContentResolver#applyBatch(String, ArrayList)
- ContentResolver.applyBatch()}.
+ {@link android.content.ContentResolver#applyBatch ContentResolver.applyBatch()}.
</li>
<li>
Asynchronous queries: You should do queries in a separate thread. One way to do this is to
@@ -963,11 +948,10 @@ mRowsDeleted = getContentResolver().delete(
To access a provider in "batch mode",
you create an array of {@link android.content.ContentProviderOperation} objects and then
dispatch them to a content provider with
- {@link android.content.ContentResolver#applyBatch(String, ArrayList)
- ContentResolver.applyBatch()}. You pass the content provider's <em>authority</em> to this
- method, rather than a particular content URI, which allows each
- {@link android.content.ContentProviderOperation} object in the array to work against a
- different table. A call to {@link android.content.ContentResolver#applyBatch(String, ArrayList)
+ {@link android.content.ContentResolver#applyBatch ContentResolver.applyBatch()}. You pass the
+ content provider's <em>authority</em> to this method, rather than a particular content URI.
+ This allows each {@link android.content.ContentProviderOperation} object in the array to work
+ against a different table. A call to {@link android.content.ContentResolver#applyBatch
ContentResolver.applyBatch()} returns an array of results.
</p>
<p>
@@ -1028,14 +1012,13 @@ mRowsDeleted = getContentResolver().delete(
</p>
<p>
A provider defines URI permissions for content URIs in its manifest, using the
- <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">
- android:grantUriPermission</a></code>
- attribute of the <a href="{@docRoot}guide/topics/manifest/provider-element.html">
- {@code &lt;provider&gt;}</a>
+<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">android:grantUriPermission</a></code>
+ attribute of the
+<code><a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></code>
element, as well as the
- <a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html">{@code
- &lt;grant-uri-permission&gt;}</a> child element of the
- <a href="{@docRoot}guide/topics/manifest/provider-element.html">{@code &lt;provider&gt;}</a>
+<code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html">&lt;grant-uri-permission&gt;</a></code>
+ child element of the
+<code><a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></code>
element. The URI permissions mechanism is explained in more detail in the
<a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> guide,
in the section "URI Permissions".
@@ -1053,7 +1036,7 @@ mRowsDeleted = getContentResolver().delete(
Your application sends an intent containing the action
{@link android.content.Intent#ACTION_PICK} and the "contacts" MIME type
{@link android.provider.ContactsContract.RawContacts#CONTENT_ITEM_TYPE}, using the
- method {@link android.app.Activity#startActivityForResult(Intent, int)
+ method {@link android.app.Activity#startActivityForResult
startActivityForResult()}.
</li>
<li>
@@ -1063,7 +1046,7 @@ mRowsDeleted = getContentResolver().delete(
<li>
In the selection activity, the user selects a
contact to update. When this happens, the selection activity calls
- {@link android.app.Activity#setResult(int, Intent) setResult(resultcode, intent)}
+ {@link android.app.Activity#setResult setResult(resultcode, intent)}
to set up a intent to give back to your application. The intent contains the content URI
of the contact the user selected, and the "extras" flags
{@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION}. These flags grant URI
@@ -1073,7 +1056,7 @@ mRowsDeleted = getContentResolver().delete(
</li>
<li>
Your activity returns to the foreground, and the system calls your activity's
- {@link android.app.Activity#onActivityResult(int, int, Intent) onActivityResult()}
+ {@link android.app.Activity#onActivityResult onActivityResult()}
method. This method receives the result intent created by the selection activity in
the People app.
</li>