Here are several things you can do to prevent your Android phone or tablet from falling victim to a malware attack, all of which happen to be free:
Install a good antivirus app on your device and be sure to keep it updated at all times. There are several great Android antivirus apps to choose from, but I use and recommend the fantastic AVG Antivirus for Android.
Only install apps from the official Google Play Store and nowhere else. While it’s true that many legitimate companies and online services provide download links for their official apps right on their own websites, the links themselves will almost always take you to their apps’ download pages in the Google Play Store.
Never open links in emails or SMS text messages unless you are 100% certain that the emails and text messages are legitimate. And truth be told, the instances in which you can be certain that those messages are truly legitimate will be few and far between. Computer users have been unwittingly downloading malware to their machines for years simply by clicking on malicious links in emails, and now mobile devices are being attacked the very same way.
Avoid visiting unfamiliar websites unless you know them to be safe.
If you find yourself on a potentially dangerous website by accident, exit the page immediately without tapping on any links.
Perhaps most important of all, be sure to back up your photos and other files to the cloud backup service of your choice on a regular basis. That way you’ll be able to recover your files if your device is ever hit by a successful ransomware attack or virus infection. The Google Drive app makes it easy to back up your files to your Google Drive cloud storage account and it works seamlessly with virtually all Android devices.