You can learn how to program from books. Phone should be no problem either.
But it is going to be much, much harder to learn how to program anything with any decent level of complexity. Writing everything in a single file? Sure. Writing a java app which has 20 classes? Sounds like hell.
And while linux terminal isn't really programming, sending key combos like ^d sounds terrible on a phone keyboard.
Something else that PCs are much better at is context switching. Being able to alt+tab to documentation, or having that documentation on another monitor would be way better than having to switch back and forth. Although that can be remedied somewhat by using a book as a reference.
Something as simple as typing a constant in Java becomes much more difficult on a phone
private static final SOME_RANDOM_VARIABLE = RandomVariableFactory.getRandomVariable();
is not easy to write on most phone keyboards.
I think the biggest area that you'll struggle is that there isn't really any good IDE, or even editor out there.
I watch videos all the time on my phone which help me with programming. Those are easy. It's the actual doing and writing the code that will be a PITA on a phone.
May I ask why you're trying to program on a smartphone rather than picking up something like a cheap netbook?
Cheers!