Android 数据量很大的时候,如何提高UI的加载效率
巴扎黑
巴扎黑 2017-04-17 17:29:43
0
8
658

Android 数据量很大的时候,如何提高UI的加载效率

巴扎黑
巴扎黑

reply all(8)
巴扎黑

The amount of data is large. To improve efficiency, there are generally two points to consider, one is the network speed, and the other is the local loading speed.
I think the way to solve these two points at the same time should be to use a paged loading design:
1. The interface needs to upload a page (which page to load)
2. The first page is loaded by default locally. When you pull down to the last data or click on the next page, you can send the request again with the field page=2, load the second page, and then display it. Such libraries include pulltorefreshlistview, etc.
3. Optimize locally in various ways, such as listview holder, convertview and other forms. The layout should minimize nesting and use relative layout as much as possible. After the object is not used, you can manually set it to null to speed up recycling or do your own gc, etc. #🎜 🎜#

PHPzhong

Only load the area visible to the user. For example, list controls like listview can be loaded in pages

伊谢尔伦

First load a certain amount of data, and then it will prompt loading at the bottom!
Dynamic loading means loading the data put into the adapter several times. Load certain data when the user drags the view

伊谢尔伦

As mentioned above, use lazy loading

PHPzhong

1. If there are many pictures, thumbnails are usually loaded, which means that the background configures smaller pictures. If there is an external third-party picture storage server, it should have its own picture processing.
2. Lazy loading, preload the first 10 pieces of data. If 20 pieces of data are requested per page, only the first 10 pieces/less will be loaded on the first page. Let the user see the data on the screen first.
3. Check memory leaks/thread opening usage

伊谢尔伦

Page loading is optional

刘奇

Isn’t it loading in pages?

Ty80
  1. The amount of data is large. Please communicate with the server to see if you should consider paging the query. If not, the response returned by each request will take up a lot of bandwidth

  2. Can the data be considered to be stored in a local database, so that the network delay problem can be ignored

  3. Asynchronous loading of data, for example: using the popular RxJava

  4. Display it all at once, don’t load all the data, load it in pages, for example: the pull-up loading mentioned above

  5. If there are a lot of images being loaded, you can consider the caching mechanism of picasso or glide

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template