Can I do this not from objective-c?
You could use objective-c++ with cocos2d-x and use some obj-c code there. You need to rename your file extension to .mm This is normal practice to use a platform specific functionality
Ok. but what about such things in the android? Is there somewhere an example of how to do it?
You should use jni to call Android API.
More information please refer the implementation of CocosDenshion.