This is a pretty useful little app I found for Android. If you open it, you can select to re-route ALL audio to the handset earpiece, instead of the loudspeaker, if no headphones are plugged in. This is really helpful if you need to listen to something that normally only plays through the loudspeaker, but you don’t want to disturb anyone else, or you don’t want anyone else listening in. (Great, say, for an audiobook, lecture, or podcast but you forgot your headphones. Or if you need to hear something in a louder environment. The earpiece in most phones sounds better at close proximity than the loudspeaker.) Don’t forget to switch it back after, though, or you’ll never hear your ringtone/alarm.
Also be sure your android device is set to be able to install externally downloaded apk’s.