Android - Efficient way to load multiple images from remote server

前端 未结 2 555
借酒劲吻你
借酒劲吻你 2021-01-03 13:16

I have an Android application that would retrieve data (images+text) from a php remote server and display them in a GridView. I am doing the operation in the background usin

2条回答
  •  隐瞒了意图╮
    2021-01-03 13:47

    IMO - there are 2 issues , moving the images across the network to the client and getting them loaded.

    Assuming that you are using http as the protocol, you should have a multithreaded solution for http as is available in apache httpclient package. That will get the pictures to the phone fast.

    Then , you have to present the pics by getting them into memory and a cache. Here you can consider what 'gallery3D' app does with its grid and bitmaps but its pretty complicated to read thru that code.

    check out - http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

    check out code samples for loading thumbs from bitmaps.

提交回复
热议问题