The Android client does not request server data

Source: Internet
Author: User

============ Problem Description ============


Error code line
String url = "http://192.168.1.121:9090/shunfengche/requestMes?pageSize=" + pageSize + "&currentpagenumber=" + Currentpagenumber; HttpClient client = new Defaulthttpclient (); HttpGet get = new HttpGet (URL),//httppost post=new httppost (URL); try {HttpResponse response = Client.execute (get); 
    

Red and bold.

URL with browser access to normal unique data

Manifest file: <uses-permission android:name= "Android.permission.WRITE_EXTERNAL_STORAGE" ></uses-permission> <uses-permission android:name= "Android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name= "Android.permission.INTERNET"/>

Last night, the phone was able to display the server data normally the next day.

Error exception
Org.apache.http.conn.ConnectTimeoutException:Connect to/192.168.1.121:9090 timed out

============ Solution 1============


Re-brush the machine Bai. It should work.

============ Solution 2============


The server is not connected, the service may have stopped! Check again.

============ Solution 3============


Confirm that the post or get, the way you request is get, if it is post may not receive, service confirmation under

============ Solution 4============


Mobile phone network is not good, try several times.

The Android client does not request server data

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.