You drop your phone and the screen shatters. Ugh. While you've probably been smart about putting your critical data on the cloud — right? — there might be some things you still want to extract from your smartphone before you take it in for repair or swap it out for a new one. Or you not be in a position to afford a new phone right now. How do you continue to use your phone when the screen is cracked?
The only time I ever cracked a smartphone screen is when I accidentally dropped my iPhone 4s into a pool. (Waterproofing — er, water resistance — didn't come until the iPhone 7.)
That said, there are a number of other experts who know their way around broken screens, and there is a little salvation for you whether you're dealing with a shattered iPhone or Android device. You'll have more luck if the screen is partly shattered and some part of it responds to your commands, and less luck if you can't get your finger-tapping to work at all.
If your iPhone's screen is broken...
First, you're probably going to want to do anything you can to authenticate into your device and disable USB Restricted Mode. I'll get to why in a bit. If you're lucky, you can still get into your device using Touch ID, though you'll still have to deal with a shattered screen that might not be able to pull up your Settings app, depending on where it's located on your screen.
As Decipher Tools' Kelly Heffner Wilkerson writes in this excellent blog post, hold down your Home button until Siri pulls up. Once you do that, tell Siri to "Turn on VoiceOver." You can then use any part of your screen that still registers your finger and gestures to navigate through iOS.
Use this trick to type in a pin if Touch ID doesn't work (or wasn't set up). This method will allow you to get into your device and do whatever you need to do — like launch Google Photos one last time to back up those holiday images, or maybe run a manual iCloud backup real quick.
You can also just plug your iPhone directly into your desktop or laptop and rip your photos and videos (or create an iTunes backup) once you've authenticated in. And with the VoiceOver trick, you'll even be able to allow a new computer to see your iPhone, in case you're in an emergency and need to borrow a friend's laptop.
If your screen doesn't work at all, you're in for a bit more fun. You'll want to grab a Lightning-to-USB adaptor and use that to connect a simple USB keyboard to your device. You should be able to then use the keyboard's number keys to authenticate into your device with your Passcode. Turn on VoiceOver mode, as previously instructed, and you should be able to navigate through your phone and get to what you need.
As for turning off USB Restricted Mode, remember that your iPhone will flip off the Lightning port if it's been an hour since you last unlocked your device. That doesn't give you a huge window to get a Lightning-to-USB adaptor and a crappy old USB keyboard, but it's something.
If your Android smartphone's screen is broken...
If you have the right converter for your Android device, you can do the same keyboard trick: plug an old USB keyboard directly into a [phone's connection type]-to-USB converter (likely an OTG cable), and you should be able to just type in a PIN code to unlock your device.
You can even connect to your smartphone with a Bluetooth mouse, if you want to get fancy.
You can also try enabling MTP mode for your smartphone so you can transfer files off it — and you'll probably want to do a quick Web search to make sure you have the right steps for your specific Android device.
If your device has USB Debugging mode already on, or you can turn it on, you can also try a tool like Scrcpy to control your device over a typical USB connection to your desktop or laptop. Samsung's Smart Switch software or Kies might also be able to help you out, if either is applicable.
Basically, if you can somehow get MTP enabled to transfer files off manually, or USB debugging mode to use a variety of apps (or ADB) to rip files off of your device, you'll be OK. In some cases, just authenticating into your device and launching a manual backup should be enough.