4

I have to implement design in this Mockup, my List will fetch real time data from server and cache it.

The list will contain large images and up to 1000s of items.

  • User will set the limit.
  • Images can be of any size in MB or of any Resolution.
  • I will definitely re-size images if too large.

While scrolling up and/or down, the list should load data cached(stored) locally or download from server.

Since such huge list will require a lot of memory and processing (which is not available on mobile devices), I need to apply very well optimized design pattern.

Questions

Can anyone please suggest any Design pattern for this?

How would you implement this?

Relevant question: List View Design Pattern

Community
  • 1
  • 1
sm.umair
  • 41
  • 5
  • 2
    http://stackoverflow.com/questions/15621936/whats-lazylist/15622374#15622374. Use a LazyList or Universal Image Loader with a custom adapter and custom layout inflated for each row. If images are large you need to scale that down. LazyList does scaling and can cache images in sdcard. – Raghunandan Apr 17 '13 at 08:38
  • https://github.com/lalit3686/ImageCacheDemo – Lalit Poptani Apr 17 '13 at 09:13
  • Thanks @Raghunandan, Its very useful. Do you think, it will work equally good if I implement [Flip animation](https://github.com/openaphid/android-flip) instead of ListView? – sm.umair Apr 17 '13 at 09:27
  • @sm.umair i don't know i have not worked on Flip animation. Vote the answer in the link if it helps – Raghunandan Apr 17 '13 at 09:29
  • @Raghunandan Don't have enough reputation, I will vote up as soon as I have enough. – sm.umair Apr 17 '13 at 09:40

3 Answers3

1

Commonsguy (Mark Murphy) implemented a very nice endless listview here :

https://github.com/commonsguy/cwac-endless

It avoids loading a large data set for your listview and allow user to scroll more and more elements as the scrolling goes. I tested it, it's pretty neat: number of elements added when you reach the bottom, async loading, etc. You'll have to work on the scroll back part because as it is, the scrolling is dynamically incremented when you scroll down (not up).

Gomoku7
  • 1,362
  • 13
  • 31
0

You could store the image and the data in a database that you can use a cache and populate the database using a background process like a service.

FrancescoAzzola
  • 2,666
  • 2
  • 15
  • 22
0

In you case as you have lots of data specially images you should use Loader Class concept as explained by rominGuy in Google IO-2010 Here you reuse each row when it goes out of view and another row comes in visibility.

Ankit
  • 1,916
  • 2
  • 20
  • 33