It is very handy to have a smartphone mounted on your handlebars while bicycling. You can run a GPS tracking program, play music, and even take a call. A diversity of mounts are available to buy for this purpose, but many are quite expensive, while others are woefully inadequate. I actually purchased a fairly nice ball-and-socket type phone mount and it broke on the very first ride. I was fairly anguished while watching my phone bounce down the road behind me. After puzzling on the problem for awhile, I came up with a simple, elegant solution.
Smartphone holster and case
Step 1: Obtain Spare Phone Holster
I already had a holster that I liked, made by the popular OtterBox® company (but this is not an endorsement). Part of what made this project work was that I got a spare one from a friend who had changed to a different type of phone case. Thus, I was able to mount one on the bicycle semipermanently, while keeping the other for normal, daily use on my belt. I could then snap the phone out of my hip holster and right onto the bike and vice versa. I'm sure a variety of such holsters would work, and with some research, you might find a second one the same as your own in good used condition for a cheap price. With this system, you can easily pop the phone out to take a photo as well.
Step 2: Attach the Mount and Ride
The OtterBox® holster mounts easily onto the stem of a mountain bike. I simply ran one zip tie through the front part of the clip and around the handlebar stem, and another through the bottom part of the clip and around the stem (see photos). When I tightened them down, it didn't even rattle. I trimmed the ends of the zip ties off with diagonal pliers. I have used this set-up for a couple of years. It has never failed. I have removed it once to mount a handlebar rack on the bike for one particular ride and reinstalled it afterward with no problems. It's easy to cut the zip ties and put on new ones later. One drawback is that when I someday upgrade to a new phone, I will probably have to get a new set of holsters. This factor may be one reason I keep putting that day off!