Merge "Remove references to apache-http from various documents."
This commit is contained in:
committed by
Android (Google) Code Review
commit
93bb5419aa
@@ -1027,7 +1027,7 @@ and include email details such as the recipient and subject using the extra keys
|
||||
<dt><b>MIME Type</b></dt>
|
||||
<dd>
|
||||
<dl>
|
||||
<dt>{@link org.apache.http.protocol.HTTP#PLAIN_TEXT_TYPE} ("text/plain")
|
||||
<dt><code>"text/plain"</code>
|
||||
<dt><code>"*/*"</code>
|
||||
</dl>
|
||||
</dd>
|
||||
@@ -2447,7 +2447,7 @@ details such as the phone number, subject, and message body using the extra keys
|
||||
<dt><b>MIME Type</b></dt>
|
||||
<dd>
|
||||
<dl>
|
||||
<dt>{@link org.apache.http.protocol.HTTP#PLAIN_TEXT_TYPE} (<code>"text/plain"</code>)
|
||||
<dt><code>"text/plain"</code>
|
||||
<dt><code>"image/*"</code>
|
||||
<dt><code>"video/*"</code>
|
||||
</dl>
|
||||
@@ -2558,7 +2558,7 @@ and specify the web URL in the intent data.</p>
|
||||
<dt><b>MIME Type</b></dt>
|
||||
<dd>
|
||||
<dl>
|
||||
<dt>{@link org.apache.http.protocol.HTTP#PLAIN_TEXT_TYPE} (<code>"text/plain"</code>)
|
||||
<dt><code>"text/plain"</code>
|
||||
<dt><code>"text/html"</code>
|
||||
<dt><code>"application/xhtml+xml"</code>
|
||||
<dt><code>"application/vnd.wap.xhtml+xml"</code>
|
||||
|
||||
@@ -376,9 +376,7 @@ the intent.</p>
|
||||
Intent sendIntent = new Intent();
|
||||
sendIntent.setAction(Intent.ACTION_SEND);
|
||||
sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage);
|
||||
sendIntent.setType({@link
|
||||
org.apache.http.protocol.HTTP#PLAIN_TEXT_TYPE
|
||||
HTTP.PLAIN_TEXT_TYPE}); // "text/plain" MIME type
|
||||
sendIntent.setType("text/plain");
|
||||
|
||||
// Verify that the intent will resolve to an activity
|
||||
if (sendIntent.resolveActivity(getPackageManager()) != null) {
|
||||
|
||||
@@ -246,10 +246,8 @@ TrafficStats.tagSocket(outputSocket);
|
||||
// Transfer data using socket
|
||||
TrafficStats.untagSocket(outputSocket);</pre>
|
||||
|
||||
<p>Alternatively, the Apache {@link org.apache.http.client.HttpClient} and
|
||||
{@link java.net.URLConnection} APIs included in the platform
|
||||
automatically tag sockets internally based on the active tag (as
|
||||
identified by
|
||||
<p>Alternatively, the {@link java.net.URLConnection} APIs included in the platform
|
||||
automatically tag sockets internally based on the active tag (as identified by
|
||||
{@link android.net.TrafficStats#getThreadStatsTag getThreadStatsTag()}).
|
||||
These APIs correctly tag/untag sockets when recycled through
|
||||
keep-alive pools. In the following example,
|
||||
@@ -258,15 +256,14 @@ sets the active tag to be {@code 0xF00D}.
|
||||
There can only be one active tag per thread.
|
||||
That is the value that will
|
||||
be returned by {@link android.net.TrafficStats#getThreadStatsTag getThreadStatsTag()}
|
||||
and thus used by {@link org.apache.http.client.HttpClient}
|
||||
to tag sockets. The {@code finally} statement
|
||||
and thus used by the HTTP client to tag sockets. The {@code finally} statement
|
||||
invokes
|
||||
{@link android.net.TrafficStats#clearThreadStatsTag clearThreadStatsTag()}
|
||||
to clear the tag.</p>
|
||||
|
||||
<pre>TrafficStats.setThreadStatsTag(0xF00D);
|
||||
try {
|
||||
// Make network request using HttpClient.execute()
|
||||
// Make network request using your http client.
|
||||
} finally {
|
||||
TrafficStats.clearThreadStatsTag();
|
||||
}</pre>
|
||||
|
||||
@@ -52,8 +52,7 @@ android.net.SSLCertificateSocketFactory
|
||||
android.net.SSLCertificateSocketFactory}. Rather than using this class, we
|
||||
encourage app developers to use high-level methods for interacting with
|
||||
cryptography. Most apps can use APIs like {@link
|
||||
javax.net.ssl.HttpsURLConnection}, {@link org.apache.http.client.HttpClient},
|
||||
and {@link android.net.http.AndroidHttpClient} without needing to set a custom
|
||||
javax.net.ssl.HttpsURLConnection} without needing to set a custom
|
||||
{@link javax.net.ssl.TrustManager} or create an {@link
|
||||
android.net.SSLCertificateSocketFactory}.</p>
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ application manifest must include the following permissions:</p>
|
||||
<h2 id="http-client">Choose an HTTP Client</h2>
|
||||
|
||||
<p>Most network-connected Android apps use HTTP to send and receive data.
|
||||
Android includes two HTTP clients: {@link java.net.HttpURLConnection} and Apache
|
||||
{@link org.apache.http.client.HttpClient}. Both support HTTPS, streaming uploads and downloads, configurable
|
||||
Android includes two HTTP clients: {@link java.net.HttpURLConnection} and the Apache HTTP client.
|
||||
Both support HTTPS, streaming uploads and downloads, configurable
|
||||
timeouts, IPv6, and connection pooling. We recommend using {@link
|
||||
java.net.HttpURLConnection} for applications targeted at Gingerbread and higher. For
|
||||
more discussion of this topic, see the blog post <a
|
||||
|
||||
@@ -39,14 +39,14 @@ as a singleton, which makes the {@code RequestQueue} last the lifetime of your a
|
||||
of the requests, and a cache to handle caching. There are standard implementations of these
|
||||
available in the Volley toolbox: {@code DiskBasedCache} provides a one-file-per-response
|
||||
cache with an in-memory index, and {@code BasicNetwork} provides a network transport based
|
||||
on your choice of {@link android.net.http.AndroidHttpClient} or {@link java.net.HttpURLConnection}.</p>
|
||||
on your choice of the Apache HTTP client {@code android.net.http.AndroidHttpClient} or
|
||||
{@link java.net.HttpURLConnection}.</p>
|
||||
|
||||
<p>{@code BasicNetwork} is Volley's default network implementation. A {@code BasicNetwork}
|
||||
must be initialized with the HTTP client your app is using to connect to the network.
|
||||
Typically this is {@link android.net.http.AndroidHttpClient} or
|
||||
{@link java.net.HttpURLConnection}:</p>
|
||||
Typically this is a {@link java.net.HttpURLConnection}:</p>
|
||||
<ul>
|
||||
<li>Use {@link android.net.http.AndroidHttpClient} for apps targeting Android API levels
|
||||
<li>Use {@code android.net.http.AndroidHttpClient} for apps targeting Android API levels
|
||||
lower than API Level 9 (Gingerbread). Prior to Gingerbread, {@link java.net.HttpURLConnection}
|
||||
was unreliable. For more discussion of this topic, see
|
||||
<a href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html">
|
||||
|
||||
Reference in New Issue
Block a user