I've used an older android phone as a remote control for streaming Spotify but not as a host for local digital files. The real issue you run up against is that most of the streaming services update their apps with some frequency and eventually the phone (after no longer receiving firmware updates) can't run the latest streaming app.
Of course, I don't use Apple Airplay which forces you to stream tvia the phone so I avoid the issue of having the phone being the source when I'm at home. There, the phone is just a remote and volume knob at that point since I have some Denon home smart speakers that are connected directly to the home wi-fi and I use the onboard DAC. Which is fine for background music.