I was talking to a tech rep at an electronic device outlet (I will not mention the name) today and they told me that smart phones could not get infected with viruses.
Frankly, this person should know better.
Any computer can get a virus, so long as someone writes one for the platform, and exploits vulnerabilities to get it on the device. The main vulnerability with any platform is going to be the user.
With Android for example, lots of people download pirated .apk files they have no idea the origin of, and then click to allow permission to access all levels of device function, thinking of nothing more than scoring a 'free' app. A virus developer can easily exploit this behavior, then harvest data or do whatever they want on infected devices. Android even has had otherwise legitimate venders (like Blu for example) ship phones with data-spying malware on them.
iOS is less prone to this as devices are more locked down, but there used to be jailbreaking to allow unauthorized functions and pirated apps (maybe still is, I have no idea) and I'm sure viruses may have gotten a foothold that way.
For the most part though, it's not something I think the average user has to worry about, if they are not engaging in obvious risky behavior on their smartphones, and not using devices from questionable makes. (Like little known Chinese companies). I've seen people feel they have to half cripple their devices with anti-virus software like they might on a desktop, but for most people I don't believe that's really necessary.