Content of this article
- Environment
- Project structure
- Demo 1
- Demo 2
- Demo 3
- Demo 4
Environment
- Windows R2 64-bit
- Eclipse ADT v22.6.2,android 4.4.2 (API 19)
- SAMSUNG gt-8618,android OS 4.1.2
Project structure
Figure 1 Project Structure
Figure 2 Main Program Interface
SimpleList demonstrates the simple JSON data that gets the music list from the network, the JSON data is an array and is loaded into the ListView control with Asynctask. and the corresponding adpter of the Listview stipulate that the network obtains the data, how to display each line.
and use Jsonarray to convert to a JSON array.
Simplexlist Demo
Demonstrates the Xlistview control on GitHub, a demonstration provided by GitHub Xlistview. The ListView provides drop-down updates and pull-up loading capabilities. The control also provides enable or disable for pull-down and pull-up operations, not all scenarios require this two operation at the same time.
Xlistivity Demo
Just based on the previous demo, changed the data to music, but disabled the update function.
For simplicity, only one network is accessed, the data is cached, and the data is loaded repeatedly as it loads more.
Xlistanother Demo
is to simulate multiple accesses to the network on the basis of the previous demo, so that the pull-up loads more. The data is duplicated.
This demo, called multiple asynctask, does not know if this is possible, but Android does not seem to recommend this.
Download Demo
Demo ListView and Xlistview (not organized)