Most Android phones already have Gboard, Google's keyboard, installed — if not, it's a free download from the Play Store. Adding Chinese Pinyin to it takes about a minute.
Tap into any text field so your on-screen keyboard opens.
Tap the keyboard's settings icon in the toolbar above it (or long-press the comma or globe key) to open Gboard settings.
Tap Languages, then Add keyboard.
Search for Chinese, choose Simplified, and pick Pinyin as the layout.
Tap Done.
To switch keyboards, tap the globe icon on your keyboard, or long-press the spacebar and pick Chinese Pinyin from the list.
Type the pinyin for what you want to say — for example zhongwen — and tap the character you mean from the suggestion strip above the keyboard.
Using a Samsung or other non-stock Android phone? The menu names can differ slightly — try Settings → General management → Language and input → On-screen keyboard, then add Chinese to whichever keyboard app is listed there.