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

Source: Internet
Author: User

Morning: The teacher first reviewed yesterday's homework.
First, in the tools file in the Android project, parse the byte stream there without changing it, but instead turn the server-side encoding into UTF-8, and then cast the username in the Loginactivity class of the Android project.
To sum up: if a character is converted into a byte code by an encoding, 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-8just add that to the question mark.
If it is hibernate, configure to <property name= "Connection.url" > Inside
MySQL does not support Chinese, but it can be reverted to Chinese when it is taken out.
Then it's easier and quicker than httpurlconnection to finish interacting with the server.
A method for the new person who executes the method, if the Super keyword is used in the method to call its father's method, then the father is executed first, if the father's method also uses Super, then a first execution, father's father's method
Then pay attention to a website 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 parameter Builder (requestparams)
multipart file Upload, no additional third-party libraries
small size application overhead, only KB for everything I've done
Automatic Intelligent Mobile connection request Retry optimization uneven
automatic decoding supports GZIP response to requests with ultra-fast speed
Binary files (pictures, etc.) and Binaryhttpresponsehandler download
built-in parsing and Jsonhttpresponsehandler JSON response
Persistent cookies Store, save cookies to your app's sharedpreferences

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.