Exchange images between Android and PHP using base64 encoding and decoding

Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding.

Last day I tried to send a JPG picture from my Android app to a PHP server but got into trouble. Investigating my problem took me an hour so I’d like to share my solution with you.