Fortunately, avoiding this threat is simple. Don't open any links in text messages from people you don't know. And if your Android gadget asks you to install an app not from the Google Play store, decline.
To be extra safe, you can also disable third-party app installations on your Android gadget entirely. Go to Settings>>Security and uncheck the "Unknown Sources" option. You should also check the "Verify Apps" option if you have it. Now you can't accidentally install an app that isn't from the Google Play store.
While this specific attack won't work on Apple gadgets, there have been similar attacks against iPhones and iPads in the past. Again, you don't want to tap on any link in a text message or email that isn't from someone you know. You also don't want to install apps that aren't from the Apple app store.
There are plenty of other threats to your gadgets besides this one. Learn six steps you need to take now to make your gadget as safe as possible.