Send cm commands from code

Hello There,
is it possible to send cm commands using code as we do on normal terminal ?
Im interested in manipulate radio state (cm radio on/off) , power and apns.
My app is not sandboxed naturally.
Thanks in advance.

Gianmaria

You can try system() with cm command, and then save the output to a text file.
Be careful that you need to use full path when calling from system() API:

Or you can port the cm code to your app