I'm trying to improve my poker ability (only very recently started) so I am playing on online tables with no real money stakes. At least half of the players I come across just all-in pre-flop on every hand. What is the best way to deal with this? Should I play on higher stakes (but still 'e-bucks') tables? Is the only way to avoid this just to play with real money? Is there a strategy that works solidly against this (folding all except AA,AKs,KK?)? Thanks
Against players this bad it should be very easy to win. I recommend first to try to be profitable in these games before switching to real money games.
If all players went all-in all the time you could only call with AA, KK and AK. It would be profitable. Widening your range a bit however would be even more profitable. Having a 55% chance to double up are odds no poker player would say no to. I would call with strong hands, but don't be too picky. You can call with hands like 66 and KJ.
Some personal advice not related to your question:
Keep in mind that variance in these sorts of games are insane. Learning to deal with these swings in a friendly environment is a very nice opportunity for a developing poker player. Learn about variance and bankroll management and try to build your roll without ever really risking going broke. Only then play for real money at the lowest stakes and repeat.
"Playing" for no real $ stakes is a waste of time but for learning the rules and procedures (i.e., "getting comfortable". Even the "fixed fee" subscription sites are conducive to maniacal play ... one can always reload ... "no pain, no gain".
Once - ASAP - you achieve a comfort level, you should compete for at least small stakes. As well, I can assure you that the size of the stakes in no way indicate skill levels.
Simply get into the lowest stakes ring games or SNG's available and develop a comfort level. Move your way up from there.
I've seen complete morons in big money games - I've seen very good players in "low stakes".
But you have to have some skin the game in order to learn.