Achieving a perfect photo on a smartphone can be difficult, but not when you use the AE/AF Lock feature on your camera. This allows you to keep your desired focus from automatically adjusting, so no matter how you move your device, your subject remains clear.
iPhone: Open Camera App > Tap and hold on subject until yellow square appears > “AE/AF LOCK” shows at the top of the screen.
Android: You’ll need an app to give you the AF lock ability. Try Camera FV-5, available in the Play Store.