Generally, you can do some coding on tablets, but typing on the touch screen is a real pain in the rear.
If you can hook up a bluetooth keyboard then it's ok.
There even is a Java IDE AIDE for android tablets available. Also, there are some Python IDEs available for Android.
Can't speak for iOS devices as I don't own one.
On Android: AIDE
It's 100% possible to develop a complete game from scratch (including the artwork) using AIDE + some image editor, but it's monk's works if you plan to touch-type everything. You need a keyboard at least IMHO
I tried. I did 80% of a minesweeper game on a 5" screen phone in a few months of riding the train to work. I abandoned it because I was going crazy from the typing.
The easiest way to procede is to install Termux (SpartacusRex' Terminal IDE won't work on newer devices, maybe a couple other also-ran contenders) but go with Termux. Do that first and report back. Also consider AIDE but do Termux first. The initial downloads/installs are a bit big but should be okay on phone plan...
>Idle game code was written entirely on a mobile device using AIDE.
That seems like a level of dedication for on-the-go programming. Why not use a computer at that point? As much as google keyboard is amazing, I'd never use my phone instead of a keyboard.
I tried a while ago on my phone with AIDE. You wouldn't want to do it all day every day, but it's not as bad as you would expect.
For a while I even experimented creating my own vim style keyboard.
There already is one in AIDE, so I'd suggest looking there first to see what killer features everyone wants that few people think of at first(like github integration, etc).
Having said that I use AIDE on my tablet only because seats on the train to work are hard to find, and 2 hours per day is a long time to spend attempting to code on a laptop with no place to sit down.