There are no viruses for android (self-propagating malware), so the way you pick up a malware infection is by installing an infected app yourself. So if you are careful what you install (check permissions first: if it wants things it doesn't need to carry out its functions, possibly including providing ads, then be suspicious), and in particular are careful where you install from, you can eliminate most of the risks just by doing that.