The only reason you would want to have a "left to right" and vice versa animaton is if they are actually different. If this is not the case you simply flip your sprite on the y axis to -1 and back to 1 depending on the direction your sprite is walking in. If he is normally facing right, -1 will make him face left.
Usually a full character animation fits onto one sprite sheet.
Try TexturePacker ( semi-free)
or
libgdxs texturepacker (free)
The files these packers generate could surely be used in AndEngine.
I also recommand looking at LibGDX for gamedevelopment on Android. It takes a bit more effort to setup but in the end it gives you far more freedom.
If I use single sprite sheet for every animation it size will increase and it will throw a exception of virtual memory exceed!
You need to optimize your TextureAtlas/SpriteSheet. Like I said, keep the animations for both directions to a single direction and just flip your sprite. You can also reduce the quality of your sheet to a point you won't notice and save up on memory use.
Edit:
As to your comment below:
You simply need to bind/swap textures then. I suggest creating a class with animation properties ( like the amount of frames, framerate, rectangle size, etc) that also holds the sprite sheet texture.
Then you have animation player class that holds all of these animation objects.
This is just an example and not the absolute way ( I don't know about the build in sprite sheet application of AndEngine, just throwing a bone here):
class SingleRowSpriteSheet{
private MySpriteSheetTexture sheet;
private Rect rect;
private int frameRate;
private int frames;
private currentFrame;
public MySpriteSheetTexture getSheet(){return sheet;);
public drawOnTo(MyTextureTarget target); // Draws on your texture, also binds the texture if it's not already done.
public update(); // update currentFrame and looping
}
\
import java.util.*;
class SingleRowAnimator{
private MyTextureTarget target; // don't know the texture class for AndEngine. but it's the reference to the texture of your sprite;
private SingleRowSpriteSheet currentAnimation;
private HashMap map;
//Using a hash map so that you can call animations by name
public void animateTo(MyTextureTarget texture);
public void addAnimation(String name, SingleRowSpriteSheet srss){
map.put(name,srss)
};
public void playAnimation(String name, int atFrame){
currentAnimation = map.get(name);
};
public void update(){
// do update stuff here
currentAnimation.update();
currentAnimation.drawOnTo(target) // draws onto your target.
}
etc.
}
SingleRowAnimator would be an aggregated object put in your entity object.
Then when you need to change animation simply call:
playAnimation;
This is just a rough idea of how you COULD do it. I hope this helps.
edit:
Just noticed that these 2 class names are a bit misleading. But just look at the idea.
edit:
What I don't get is, even for this, you would need to load every SpriteSheet into your game. So to my idea this would also cause a memory error.
Make sure you are working with textures that are sized for your target resolution. Use bilinear/trilinear filtering to smooth out the pixels.
As an alternative to my solution, see if there is a way to copy pixels from a spritesheet unto your texture target.