设备喜欢
- 三星 GalaxyTAB2 GT-P5113 安卓操作系统 4.1.1
- 联想安卓手机
在许多设备中,我的 InternetReachability 代码都可以使用
但上面的设备没有工作
Toste Message "Not Connect to the Internet"
互联网可达性代码
public boolean currentStatus(Context context)
{
try
{
if (context==null)
return false;
ConnectivityManager connec = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
return ( connec.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnectedOrConnecting() || connec.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnectedOrConnecting() );
}
catch(Exception ex)
{
ex.printStackTrace();
return false;
}
}
当我可以在没有互联网 InternetReachability 代码的情况下从亚马逊下载产品时
错误会像这样发生
05-01 13:26:36.154: I/System.out(16813): THREAD IS ALIVE.
05-01 13:26:36.404: E/SpannableStringBuilder(16813): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
05-01 13:26:36.404: E/SpannableStringBuilder(16813): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
05-01 13:05:13.589: I/System.out(15658): THREAD IS ALIVE.
05-01 13:05:15.425: I/System.out(15658): ERROR in run() ----> : Status Code: 403, AWS Service: Amazon S3, AWS Request ID: 6D55BDA68E575EC9, AWS Error Code: RequestTimeTooSkewed, AWS Error Message: The difference between the request time and the current time is too large., S3 Extended Request ID: 8mfkdgLLXu2Zt1dsAkBdwAw7Qd2Ha4Ngyazg807u504/ZGbnS1tWNilV8kVUaknW
05-01 13:05:15.425: W/System.err(15658): Status Code: 403, AWS Service: Amazon S3, AWS Request ID: 6D55BDA68E575EC9, AWS Error Code: RequestTimeTooSkewed, AWS Error Message: The difference between the request time and the current time is too large., S3 Extended Request ID: 8mfkdgLLXu2Zt1dsAkBdwAw7Qd2Ha4Ngyazg807u504/ZGbnS1tWNilV8kVUaknW
05-01 13:05:15.433: W/System.err(15658): at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:583)
05-01 13:05:15.433: W/System.err(15658): at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:317)
05-01 13:05:15.433: W/System.err(15658): at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:167)
05-01 13:05:15.433: W/System.err(15658): at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2781)
05-01 13:05:15.433: W/System.err(15658): at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:872)
05-01 13:05:15.433: W/System.err(15658): at org.Infoware.fb.DownloadThread.run(DownloadThread.java:113)
05-01 13:05:19.199: I/AmazonHttpClient(15658): Unable to execute HTTP request: No peer certificate
05-01 13:05:19.199: I/AmazonHttpClient(15658): javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.apache.harmony.xnet.provider.jsse.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:137)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:93)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:165)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:285)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:167)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2781)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:872)
05-01 13:05:19.199: I/AmazonHttpClient(15658): at org.Infoware.fb.DownloadThread.run(DownloadThread.java:113)
05-01 13:05:19.199: I/System.out(15658): ERROR in run() ----> : com.amazonaws.AmazonClientException: Unable to execute HTTP request: No peer certificate
05-01 13:05:19.199: W/System.err(15658): com.amazonaws.AmazonClientException: Unable to execute HTTP request: No peer certificate
05-01 13:05:19.199: W/System.err(15658): at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:332)
05-01 13:05:19.199: W/System.err(15658): at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:167)
05-01 13:05:19.207: W/System.err(15658): at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2781)
05-01 13:05:19.207: W/System.err(15658): at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:872)
05-01 13:05:19.207: W/System.err(15658): at org.Infoware.fb.DownloadThread.run(DownloadThread.java:113)
05-01 13:05:19.207: W/System.err(15658): Caused by: javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
05-01 13:05:19.207: W/System.err(15658): at org.apache.harmony.xnet.provider.jsse.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:137)
05-01 13:05:19.207: W/System.err(15658): at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:93)
05-01 13:05:19.207: W/System.err(15658): at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)
05-01 13:05:19.207: W/System.err(15658): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:165)
05-01 13:05:19.207: W/System.err(15658): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
05-01 13:05:19.207: W/System.err(15658): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
05-01 13:05:19.207: W/System.err(15658): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
05-01 13:05:19.207: W/System.err(15658): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
05-01 13:05:19.207: W/System.err(15658): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
05-01 13:05:19.207: W/System.err(15658): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
05-01 13:05:19.207: W/System.err(15658): at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:285)
05-01 13:05:19.207: W/System.err(15658): ... 4 more
所以我必须做什么....我的 InternetReachability 代码和下载代码在所有设备上都能正常工作但上述设备无法正常工作......所以请帮助我