I want to change animation with the movement of Accelerator. If there is no movement of accelerometer the I want to display one animation. If there is movement of accelerometer then the other animation must be displayed. I am using 2 .xml files having animationlist tags(which are in .xml file which is in the res->drawable folder)and having tags representing 5 images with durations specified in each item tags in the animationlist tag. Like this I am having two .xml files each representing two different animations. With the movement of accelerometer these two changes in animations must occur. Can anyone suggest me the code ?
I resolved by the following steps:
Called in that particular image which I want to animate when phone is moving by placing in the loop when the speed is greater than the threshold, and the other animation outside when there is no movement of the phone
It worked! You can start here This code provides a good understanding of phone movement http://www.clingmarks.com/how-to-detect-shake-motion-on-android-phone/25.