views:

41

answers:

1

Hey, I checked tons of tutorials and guides but somehow can't find it...

I need to include multiple images in my Android app. It's like an image viewer/slideshow. Currently I switch between pictures from /drawable-mdpi dir simply with ImageView and adapter, using gestures to left/right. Works but nothing impresive :/

Basically I could use something like Android (2.1) gallery with some image show animation.

1st question: what's the best way to include many (50-100) fullscreen images in App?

2nd: is it possible to use ViewFlipper animations directly to images? or do i have to somehow populate Views?

A: 

1st question: what's the best way to include many (50-100) fullscreen images in App?

Any approach that only involves a couple of images being in memory at one time. Full-screen images are large; you will run out of RAM.

2nd: is it possible to use ViewFlipper animations directly to images? or do i have to somehow populate Views?

You would have to use ImageViews as the children of the ViewFlipper.

I would recommend sticking with what you have and just apply animations.

CommonsWare
Thank you for reply. Currently I use such function and animation seems to work (though I guess animation I will apply somewhere earlier). public void show() {this.imgView.setAnimation(AnimationUtils.loadAnimation(this, R.anim.fade));this.imgView.setImageResource(MyImageSet[currImg]);}Are you saying I'll run out of memory after scrolling to some, for example 30th, image? I guess the images will be max android screen size (480x854) or is it enoght to keep them medium and allow Android to strech them? I really hope to make app under 10 MB, so would that eat a lot of RAM?
yosh
@yosh: "Are you saying I'll run out of memory after scrolling to some, for example 30th, image?" -- probably before that, unless you are recycling the previous bitmaps. "I guess the images will be max android screen size (480x854) or is it enoght to keep them medium and allow Android to strech them?" -- I do not believe that has an impact.
CommonsWare
Well Adapter is recycling old images. I tried now with 30 images and it works quite good. Now I'll have to decide what resolution to put them in :) Higher res reduced to screen size has some lines :( Thanks for help!
yosh