Haven't tried this found it at anutter place.
1.Download Google Pinyin from the market
2.Go to your messaging app and long press where you want to start typing, should bring up a dialogue box "input method" select that and you should have a choice between Pinyin and the standard android keyboard.
Hope this helps.