巴扎黑2017-04-17 17:31:43
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. #🎜 🎜#
PHPz2017-04-17 17:31:43
Only load the area visible to the user. For example, list controls like listview can be loaded in pages
伊谢尔伦2017-04-17 17:31:43
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
PHPz2017-04-17 17:31:43
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
PHP中文网2017-04-17 17:31:43
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
Can the data be considered to be stored in a local database, so that the network delay problem can be ignored
Asynchronous loading of data, for example: using the popular RxJava
Display it all at once, don’t load all the data, load it in pages, for example: the pull-up loading mentioned above
If there are a lot of images being loaded, you can consider the caching mechanism of picasso or glide