There is a lot that you can do using your Android or iOS phone but when it comes to adding code blocks to texts it is better to do it from a desktop or laptop. this way you are sure that the text copied is formatted right and you have the entire text copied in one go. This being said you can insert a code that is copied on the application on your phone. The only difference is you will not have as many editing options.