views:

34

answers:

1

I am trying to create an app where, when you search for a particular animal, from a webservice, I get all the Animal names I have on my server along with their Image URLs. What I want to do is to sift through these Images like you can in case of an album art.

If I have to cache(i.e. ship) the images with my app, I will do that to improve the experience. However the major question I have is implementing this Album Art kind of functionality.

What should I use? 2D, 3D animation? OpenGl? Any samples greatly appreciated.

+1  A: 

It depends on what kind of effects or transitions you want to achieve, but I would recommend using Android views.

If you want to scroll through a vertical list of images, just use a listview containing ImageView. See this api demo : http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List8.html

If you want to scroll horizontally, have a look at the gallery view http://developer.android.com/guide/tutorials/views/hello-gallery.html

Regarding caching, these views support on-demand loading. This is done in your adapter getView method. This methods gets called when the user scroll through your images. Contrary to what the examples shows, you shouldn't always create a new view in this method. If convertView is not null, this means you have to convert this view to contains your new content.

Now, you could of course also do that using OpenGL. But you will have to start from scratch and you will have to rewrite most of what the previous views (Gallery, ListView) have already written for you. So I would only recommend OpenGL if you want fancy animations between your photos.

Julien
Moreover, openGL uses more battery, and as the android sdk says, users are pretty smart at figuring out what eats out their battery.
Calvin1602