EDITED my question: Is there any encoders from PCM raw data to any audio file? mp3,ogg... but not WAV, as it will be too big
I do have a text file which has raw PCM
there is a github project that provides lame encoder for android
https://github.com/intervigilium/liblame
there is also an sample app that uses the library
https://github.com/intervigilium/Lame4Android
but as allready stated, if you want to encode/decode a mp3 file you may have to pay license/patent fees.
here you can find the mp3 license prices
http://mp3licensing.com/royalty