Yes it is possible.U can take me as example but now I have laptop. Just buy external keyboard if ur not comfortable with ur keyboard .I used increase font size of sololearn code playground and I used to type with my external keyboard. External keyboard may cost around rs 500 .
An iPhone costs almost three times what I spent on my daughter's laptop and more than my son's gaming laptop.
I've written Java, C, C++, HTML and assey on a Wondermedia WM8650 7" netbook with only 256 MB of RAM before. If it's got a keyboard and can show at least 80 x 25 characters on screen in a readable font I can live with it.
Modern phones are far more powerful than the IBM PC XT machines I used years ago but the screen size and the lack of a keyboard make prolonged typing a pain. Wait until you need to debug code using a phone. The time lost alone will justify the cost of a cheap laptop.
With cloud based ides like...
Eclipse Che https://www.eclipse.org/che/
all you need is a web browser anyway.