Detailed explanation and example of Android network HTML source code viewer
Detailed explanation and example of Android network HTML source code viewer
Understanding of data transmission of IO byte stream
Basic use of handler
1. Exhibition of works
2. Knowledge to be mastered
Read / write usage and differences of FileInputStream, fileoutputstream, bufferinputstream and bufferoutstream
Basic steps for requesting a URL address
Use urlconnection to request a URL address to get content:
Writing method and basic principle of handler message mechanism
3. Detailed knowledge
Message mechanism principle
1. Message: used to carry the data in the child thread.
2. Messagequeue: used to store messages sent by all child threads
3. Handler: used to send messages in the child thread, accept messages in the main thread, and process results
4. Looper: it is a message circulator that circulates through the messagequeue, takes a message from the messagequeue and sends it to the handler for processing.
Handler principle.png
4. Project code
5. Reflection and summary
1. I don't understand the basic principle of HTTP protocol corresponding to the web, so I can't understand the network transmission
2. Pay attention to registering in the configuration file to obtain network permissions, which almost GG happened
3. I started to contact some logic codes in the background, some of which are not very understood, but there are still gains in the process. Take your time
Thank you for reading, hope to help you, thank you for your support to this site!