A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service
Read the in-depth understanding of Android network programming feels good. Today's Android network programming is a key record.
Android Web-based technology and programming practices
|A data-oriented protocol for message exchange networks|
|TCP protocol||Transmission Control Protocol, transport-layer communication protocols.|
|UDP protocol||User Datagram Protocol. Transport layer protocol.|
|SMTP protocol||Simple Mail Transfer Protocol|
|Socket sockets||The intermediate software abstraction layer that the application layer communicates with the TCP/IP protocol family.||There are two kinds of types: TCP sockets and UDP sockets.|
|TCP sockets||In the guarantee reliability, adopt the time-out retransmission and the piggyback confirmation mechanism, in the flow control, adopt the Sliding form protocol, on the congestion control. The slow-start algorithm is used.|
|UDP sockets||Compress the network data traffic into the form of a packet.|
|FTP protocol||File Transfer Protocol, the application layer of the transport Protocol.||Can operate Apache's package directly|
|Telnet protocol||Standard protocol for Remote login services||Can operate Apache's package directly|
|Differences between C + + and Java sockets||The socket is the original socket development interface API in Winsock.||1, the interface is different, the Java itself does not have the socket communication bottom implementation, but calls the system's underlying Winsock API two encapsulation; C + + is closer to the system-level Winsock, enabling many other underlying extensions and controls.
2, Java can be developed in support of Java Virtual machine execution.
|UDP and TCP differences||1, TCP reliable, UDP unreliable
2, TCP supports the application protocol is: TELNET,FTP,SMTP,TCP can be a large number of user data transmission
3, UDP Support Application Protocol: NFS (Network File system), SNMP (Simple Network management System), DNS (primary domain Name System), TFTP universal File Transfer Protocol, etc., the user data transfer less.
Android basic Web technology and programming practices
|HTTP protocol||Application layer Protocol of Distributed hypermedia Information System.
/HTTP Host [":" Port][Path]
1. Support C/S mode
2, simple high-speed
4. No connection
5. No status
Two types of messages: Request messages, response messages.
Supported features include: self-directed steering, HTTPS protocol, Proxy Server, methods (get, post, put, head, opption, connect)
|Implementation: Data request, data upload, data deletion and other operations.
Actionable classes: HttpClient and URLConnection.
Jsonobject, Jsonarray, Jsonarray, Jsontokener, Jsonstringer.
|Soap||Simple Object Interview protocol. Application layer protocol.||Included elements: Envelope, Header, Body, Fault.|
|Html||Hypertext Markup Language||The methods for parsing HTML documents are:
1, the form of the expression
2. String positioning
3. HTML Parser Parser
4. Jsoup Parser
|How to encrypt?||Data transfer can be encrypted by adding an encryption algorithm||Encryption algorithms include: self-defined displacements (others), MD5 (irreversible), symmetric encryption (DES, AES), asymmetric encryption (RSA)
The crypto package can be introduced.
Android Common Network Interface programming
|Xml||Extensible tagging Voice||Creating an XML file using XmlSerializer|
|Dom parsing||A way of parsing XML, characterized by storing the entire contents of an XML file in memory in the form of a document tree, and then using the DOM API to traverse the XML tree and retrieve the required data.||The Required classes:
Documentbuilderfactory, Document, Element, NodeList.
|Sax parsing||A way of parsing XML, features: event-driven, edge-loaded edge parsing.||The Required classes:
XMLReader, ContentHandler, Dtdhandler, ErrorHandler, Entityresolver
|Rss||Simple information aggregation. A format for describing and synchronizing site content. Subscribe: Blogs, news.|
|Email programming||As the name implies: Send mail.||1. Use the system's own mail service.
2, the use of JavaMail Feature Pack to send mail.
|Add decryption||Encryption is the process of converting plaintext into ciphertext through cryptographic algorithms and cryptographic keys, and decryption is reversed.||1, Base64 encryption (character means binary data)
2, DES is the data Encryption Standard
3, AES is the Advanced Encryption Standard
4, MD5 use to ensure the integrity of information transmission
|OAuth Authentication||An open standard. Consent to third party use of the user.||Four steps:
1. Obtaining an unauthorized request token
2. Obtain the user authorized request token
3, with the authorized request token change Authentication token
4. Use the authentication token to interview
|The difference between DOM and sax||Loading in different ways. Dom loads all content at once. The sax side loads the side reads.|
Android Network module programming
|USB programming||Universal Serial Bus, a master-slave structure.||The classes involved:
Usbmanager, Usbaccessory, Usbdevice, Usbendpoint
|WiFi programming||802.11B Standard, the industry standard of wireless communication, features: fast speed, reliable, far away.
WiFi Direct connection technology is directly connected via WiFi.
|Related classes: Wirelesssettings, Wifisettings, Accesspointdialog, Wifienabler, Wifilayer, Wifimanager, WifiState, WifiService, Wifimonitor, Wifinativie, Scanresult, Wifiinfo, Wificonfiguration.
|Bluetooth programming||A wireless technology to support short-distance communication of equipment||Classes involved: Bluetoothadapter, Bluetoothdevice, Bluetoothsocket|
|NFC Programming||Technology for near-range wireless communication. 3 Modes of operation: active, passive, bidirectional. Application: Contact through, contact payment, contact connection, contact browsing.||Classes involved: Nfcadapter, Ndefmessage, Ndefrecord|
The application of VoIP based on SIP protocol
|SIP protocol||Session Initiation Protocol. Used to create, alter, and terminate interactive sessions, including video, voice, instant messaging, online gaming, and virtual reality, among other multimedia elements.||Signaling control protocol for the application layer.|
|What protocol is used for transmission?||UDP protocol and TCP protocol|
|Comparison of the + + protocol and SIP protocol||1, the use of ASN.1 and compression encoding rules of the binary method to express its message, SIP-based text protocol.
2, the multi-point control unit, all terminals to the MCU to send control messages. SIP is a distributed call model with multicast capability.
|What constitutes a SIP session?||Four components:
1, SIP user agent (terminal equipment)
2. SIP Enrollment Server (database that includes the location of all user agents in the domain)
3. SIP Proxy Server (interface UA session request and query the SIP register server for the address information of the recipient UA)
4. SIP redirection Server (to allow SIP Proxy Server to speak SIP session invitation information directed to the external domain)
Instant communication based on XMPP protocol
|XMPP protocol||Extensible Message Processing Site Protocol||An open real-time communication protocol based on XML.|
|Android's xmppclient address||http://asmack.freakempire.de/|
Android's handling of HTML
|HTML Processing Key class||Android HTML Processing key class under the source code Frameworks/base/core/java/android/webkit folder|
||33. Mimetypemap MIME Type mapping
34, mockgeolocation simulation location information
36. mustoverrideexception Extension Execution error
37. Overscrollglow used to achieve overscroller results
38. Plugin defines the plug-in class
39, Plugindata plug-in data
40. Pluginfullscreenholder gets the size of the container for the plug-in view. Responsible for display and other operations.
41, pluginlist Maintenance plug-in list
42, PlugInManager plug-in management class
43, Pluginstub WebView Implementation plug-in interface
44. QUADF defines a quadrilateral
45. SearchBox Search dialog Box interface
46, Searchboximpl Search dialog box interface implementation
47. Selectactionmodecallback Select Action Callback
48. Sslcertlookuptable the decision to store whether a user is using a certificate
49, Sslclientcertlookuptable Save the client certificate user choice
50. Sslerrorhandler Handling SSL Error
51. Urlutil URL using processing class
52. Valuecallback callback interface for returning data values asynchronously
53. Viewmanager View Management class, manage plug-in view
54. Viewstateserializer WebView View serialization and deserialization
55. List of historical data displayed in the Webbackforwardlist WebView object
56, Webbackforwardlistclient browsing History Processing Client interface
57, Webchromeclient Chromeclient
58. Webcorethreadwatchdog WebCore Watchdog
59, Webhistoryitem a Web page data
60. Webicondatabase Icon Database Management Object
61. Webicondatabaseclassic Webicondatabase Extension class
62. Webresourceresponse Package Resource response information
63, WebSettings webview management settings data. Obtained from the underlying via the JNI interface.
64. WebStorage Database
65, Websyncmanager data Synchronization management object. Synchronous operation for RAM data and flash data.
66. Webtextview displays the system native editing component when the HTML text input control is activated.
67. WebView View Object
68. Webviewclient Web View Customer object. The object is notified when an event occurs in the Web view.
Android Network Processing Analytics
|Network processing Key class||Android HTML Network processing key classes under the source Code frameworks/base/core/java/android/net folder|
|key class and descriptive narration|| 1, Connectivitymanager used to query the state of a network connection.
2, Credentials unix identity information
3, dhcpinfo A DHCP Request result object
4, Localserversocket Create a non-standard class for the downstream UNIX domain socket
5, Localsocket Create a non-ServerSocket
6, localsocketaddress socket address
7, MailTo in the Unix domain namespace Parse the URL of the Mailto protocol format
8, networkinfo description of the network interface status
9, proxy access to the user and the default proxy settings class
10, sslcertificatesocketfactory Additional details for SSL operations
11, Sslsessioncache ssl Session cache
12, trafficstats network traffic statistics
13, Uri An immutable URL reference
14. Uri.builder Create an auxiliary class for URL reference
15, urlquerysanitizer Filter URL query
16, Urlquerysanitizer.illegalcharactervaluesanitizer filter illegal values with the characters they include
17, Urlquerysanitizer.parametervaluepair A simple tuple of value pairs
18, Vpnservice Apply extensions and establish your own base class for VPN solutions
19, Vpnservice.builder Create a secondary class for a VPN interface
|HTTP processing classes for Android encapsulation||1, androidhttpclient (essentially Apache Defaulthttpclient class on Android implementation)
2, Defaulthttpclient (a httpclient)
3, the SSL authentication Information processing class (SSL protocol implementation and the digital certificate correlation, relates the class: Sslcertificate, Sslerror)
|1. Androidhttpclient cannot be executed in the main thread, Defaulthttpclient is executed in the main thread.
2, androidhttpclient through the static method Newinstance obtains the instance. Instead, Defaulthttpclient creates the object.
3, defaulthttpclient The default startup cookie, but the default does not retain cookies, such as to retain the need to add Cookiestore to HttpContext.
|Android RTP Protocol||Real-time transport protocol. It is used to provide end-to-end real-time transmission service for multimedia data such as voice, image, fax and so on in IP network.
||Classes involved: Audiocodec, Audiostream, Audiogroup, Rtpstream.|
This book explains the essentials of Android development in detail. and the source code case for the specific description, so that the author from the principle of deepening the understanding of the relevant knowledge points.
Android Network Programming record
Start building with 50+ products and up to 12 months usage for Elastic Compute Service