That's easily accomplished... keep "Unknown sources" disabled in Settings/Security unless you really need it, and enable "Verify apps". This isn't really a virus, it's malware and can only be 'caught' by installing it, which these measures should prevent.