Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Animation Problem

So I created my own app. Very similar to the Crystal Ball app. It has no errors or anything. Then I click the run button. It worked perfectly until I tried to shake the device. It stopped. I have my own animation. Also stored in the XML file. In the errors it says "java.lang.OutOfMemoryError" then a very long error list. The animation should be triggered on shake. Thanks! :)

2 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hi Vince,

Unfortunately the type of Frame animation we use in the Crystal Ball app is very resource intensive. You need to make sure your images are scaled down enough to avoid this OutOfMemoryError. They quickly add up to consume available memory -- it's a pain! There are some good points about the reason for this and potential solutions in the StackOverflow thread: http://stackoverflow.com/q/8692328/475217

Hi Ben! Thanks for your reply. May I ask what is your recommended settings for creating an app background image in Photoshop. Thanks! :)

Ben Jakuben
Ben Jakuben
Treehouse Teacher

I wrote an answer on StackOverflow that talks about creating image files for Android that might help. :)