Will there be a memory issue if we use lot of frame by frame animation in android
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That depends entirely upon how you implement it, and details such as how large your frames are and what kind of color-depth you choose to use. In general, however, you should be able to come up with a rendering algorithm that doesn’t hold references to more than a handful of frames at any one point in time.
Ideally you should only need a reference to the previous frame and your working buffer for the current frame. Assuming that’s the case, and assuming that you’re using 8-bit RGBA pixel encoding, then you can easily work out how approximately much memory your animation will consume when running. It’s:
frame.width * frame.height * 4 * 2bytesAnd then from that you can make a reasonable estimate of whether or not your device can meet your memory requirements. As a general rule, as long as your frames are not larger than your device resolution you should be okay.