Android Network HTML viewer and androidhtml Viewer
This document provides an Android-based network HTML viewer.
Create a project. The project layout file is as follows:
Create a tool
Html code viewer, code ViewerHtml code Viewer
Effect:
Analysis:
1. permissions required to connect to the network
2. Write the default protocol and default ports http and 80
3. Put the network access code in AsyncTask.
4. Two methods for obtaining content types
String contentType = conn. getHeaderField ("Content-Type ");
Conn. getContentType
5. Split Function
(len = instream.read (buffer))!=-1) {
outstream.write (buffer, 0, Len);
}
Instream.close ();
return Outstream.tobytearray ();
}
Web page Source Viewer
Scroll bars are required if the source of the page exceeds the display position of the screen.
The interface is as follows:
Example
@Override public void OnCreate (Bundle savedinstancestate) {super.oncreate (Savedinsta
Ncestate);
Setcontentvie
This series of tutorials is dedicated to the quick learning of Android development, in accordance with the project approach, usually an article will do a small program. Improve your interest in learning.On the one hand to summarize their own income, on the other hand can help more study colleagues through their own sharing.Because of the coherence of knowledge, it is recommended to study in a twinkling. Directory Links: http://www.chengxiaoxiao.com/bo
Address: http://apistore.baidu.com/apiworks/servicedetail/113.html
Second, the required technology
Network requests
JSON parsing
Third, actual combat projects:3.1 Front-desk interface: It's easy to put a code on it. Obtain ID information by entering the ID number.3.2 Background Control initialization:3.3 Network Requests1. Use the Network debugging tool to find that the JSON returns the following structure:2. Using
explanations.Visible TimerTask can be seen as just an event, while a timer is a queue1.Timer
Java.util.Timer Timer = new Java.util.Timer (true);
True indicates that the timer runs in daemon mode (Low priority,
Program End timer also end automatically), note that javax.swing
There is also a timer class in the package, if you use the Swing package in import,
Pay attention to the clash of names.
TimerTask task = new TimerTask () {
Public void Run () {
...//each ti
I am a senior dog who is about to graduate. I am currently working as a front-end development intern in a network company, and I am very satisfied every day. However, it is a headache to think of graduation design. The question I selected is "Design and Implementation of the Course Selection System Based on the Android platform". It seems very simple, but obviously I am not good at it and I am not intereste
In android development, layout files are usually described in xml format. Currently, few people are familiar with android layout and beautification, and serious faults have occurred. In most enterprises, programmers are still working on their own. This will not only waste time and energy, but may not achieve the desired results. However, in enterprise-level
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.