increase android performances with images

You must Login before you can answer or comment on any questions.

Hi, in my android app i display 25 images using the background image of buttons, the problem is that my app performances are very slow, do you have some experiences with this?

3 Answers

I had a similar issue. I had no luck in solving it, but I did find that according to fastdev, every image is loading four times. I put up the ticket TC-1140 but it hasn't yet been updated. I'm not sure if it is loading four times or if it just fastdev being strange. Perhaps if it is fixed it might speed things up.

— answered 9 months ago by Kyle Berezin
answer permalink
2 Comments
  • hi, i think that fastdev is disabled by default in newer versions of titanium sdk

    — commented 9 months ago by Raffaele Chiocca

  • The question is, is fastdev the problem? or is fastdev showing that there is a problem with the current titanium sdk. You could try using a sdk older than 2.1.0 and see if that helps.

    — commented 9 months ago by Kyle Berezin

Why do you need 25 200 KB images in a single view? That's 5 MB of image data to deal with. I'm assuming that you're not showing them at full resolution on the screen. If you're not, then can you provide the images to your application at smaller sizes?

— answered 9 months ago by Jason Priebe
answer permalink
3 Comments
  • i don't display them in a single view, 25 images are in the entire application

    — commented 9 months ago by Raffaele Chiocca

  • Hmmm... that's a bit strange that 25 images throughout the application are slowing you down. Are you certain that it is the images? What if you remove those images from your buttons and test? Is it still slow?

    I do think that 200KB seems pretty large for a button background.

    — commented 9 months ago by Jason Priebe

  • i put all of these images in some buttons and then put everything in a tableview, if i remove those images and the tableview, the app runs faster, maybe is something with the dimensions of the images?or the type of the images

    — commented 9 months ago by Raffaele Chiocca

So you are putting all 25 200KB images on one view -- they're all descendants of the TableView. That's what I was asking. It would be one thing if you put a single 200KB image onto a view, then in another window, you display another 200KB view. But loading a TableView with 200KB images is a bad idea.

See this screenshot. I have a table with about 25 rows in it, each with a photo. The app performs very smoothly under iOS and android.

But my images are 160x120, which results in file sizes around 4-5 KB. Not 200 KB. All 25 of my images don't even match the size of one of your images. I don't know if these images are from your Resources directory, or if they're coming from a server, but you need to downsample your images before you give them to Titanium.

— answered 9 months ago by Jason Priebe
answer permalink
3 Comments
  • i don't put every 25 images in a single tableview, i put only 10 images in my tableview, my images are of 180x180 in .png format, all the images are on the filesystem, the size of my images is 40kb

    — commented 9 months ago by Raffaele Chiocca

  • This is not what you said in your first post ("my images dimension is of 200kb"). It's very hard to provide support when you keep moving the target.

    — commented 9 months ago by Jason Priebe

  • Sorry in another window i have a tableview with button Images of 200kb

    — commented 9 months ago by Raffaele Chiocca

Your Answer

Think you can help? Login to answer this question!