3

We are building an app for Android Tablet that has one feature where it has rows of horizonal scrollviews. Think of it as a ListView and each item in the ListView is a HorizontalScrollView. As a side note, this is the design that we have no influence of to change and the one that makes sense for the UX of the app.

In each of this horizonal scrollview, there will be list of images that span horizontally. Now the thing is the number of images in each horizontal scrollview can be large (between 100-500 images each row) and we are planning to lazy load them by loading 25 at a time and as the user scrolling towards the end, we will load more images

Now the two options that I am considering are the following :

  • Very likely we are going use ListView combined with the Horizontal List View pointed out by this SO Question (we took the two options we had Gallery and HorizontalScrollView as we don't like the center locking feature of the Gallery and HorizontalScrollView doesn't have the feature that AdapterView has)

  • Use WebView and build this HorizontalScrollView via HTML using Javascript Library for touch devices such as Sencha or JQTouch

Now since potentially we are going to load tons of images, I am thinking that we are going to be susceptible to the dreaded OutOfMemoryException. My question are:

  • "Based on your experience, which one of the two approaches is more memory efficient and why?"
  • Does HTML elements and interactions in WebView use the allocated heap memory or does it have its own space and memory management?

Any pointer, hints and links that would lead to the answer is much appreciated.

Community
  • 1
  • 1
momo
  • 21,233
  • 8
  • 39
  • 38
  • 1
    Common sense says the ListView control is better. At least on iOS, list items are aggressively recycled to avoid the dreaded OOM - probably on Android, too. – Seva Alekseyev Sep 07 '11 at 23:46
  • 1
    Agreed, which is why option 1 is a more likely solution, however if someone has proven statistic more than common sense, that would be better. I also don't like the restriction to a specific heap size per application in Android and if WebView has a different memory management, that would be interesting alternative design to consider. I'll start exploring these two tomorrow and post an answer if I find anything interesting. I thought I asked first to see if anyone has similar problem – momo Sep 08 '11 at 00:00
  • @momo: Did you find anything interesting? – user802421 Aug 19 '12 at 12:35
  • @user802421 Native seems better for Android. We found that webview can still crash Android. This is interesting as I thought the WebKit would handle it for me. The interesting part is WebKit in iPad does handle this kind of interaction better and we can go with HTML5 solution with the iOS. – momo Aug 21 '12 at 01:49
  • @momo been a while. Any update/after thoughts for android? Any data would help. – Sundeep Jan 27 '13 at 14:25

0 Answers0