Androsh fourth day--based on httpclient to complete the interaction of the data between the server and the device.

Source: Internet
Author: User

Morning: The teacher first recalled yesterday's homework.
First, in the tools file in Android project, parse the byte stream there without changing it. Instead, the server-side encoding is changed to UTF-8, and then the username in the Loginactivity class of Android project is forced to convert it.
To sum up: Suppose a character is converted to a bytecode by an encoding, then you must get the bytecode supplement before conversion: How do I change the encoding of the MySQL connection tool: Jdbc:mysql://localhost:3306/databasename? Useunicode=true&characterencoding=utf-8you can add that to the question mark.
If hibernate is configured to <property name= "Connection.url" > Inside
MySQL does not support Chinese, but it can be restored to Chinese when it is taken out.
Then it's easier and quicker than httpurlconnection to finish interacting with the server.
A method of the new person who runs the method, assuming that in the method used Superkeyword call its father's method, then first run the father, assuming the father's method also used super, then first run, Father's father's method
Then pay attention to a site GitHub, the following is translated from the site above httpclient related content: Features
  • Make asynchronous HTTP requests, handle responses in anonymous callbacks
  • HTTP requests happen outside the UI thread
  • Requests use a threadpool to cap concurrent resource usage
  • Get/post params builder (requestparams)
  • Multipart file uploads with no additional third party libraries
  • Tiny size overhead to your application, only 25kb for everything
  • Automatic Smart Request retries optimized for spotty mobile connections
  • Automatic gzip response decoding support for super-fast requests
  • Binary file (images etc) downloading withBinaryHttpResponseHandler
  • Built-in response parsing into JSON withJsonHttpResponseHandler
  • Persistent Cookie Store, saves cookies into your app ' s sharedpreferences
features
makes an asynchronous HTTP request to process the response in an anonymous callback
HTTP requests occur in the UI thread
request use of ThreadPool Caps concurrent Resource Usage
get/post number Builder (requestparams)
multipart file Upload, no additional third-party libraries
small size application overhead, just a KB for everything I've done
Self-Active Intelligent Mobile connection Request Retry optimization difference is not aligned
Self-actively decode the request that supports GZIP response speed very fast
Binary files (pictures, etc.) and Binaryhttpresponsehandler download
built-in parsing and Jsonhttpresponsehandler JSON response
Persistent cookies Store, save cookies to your app's sharedpreferences

Androsh fourth day--based on httpclient to complete the interaction of the data between the server and the device.

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.