Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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. :)