So I finally got my app to work on android devices.
However, I get no sound on those devices…. I believe I copied all the required files from the test and HelloWorld examples. I have successfully built the libcocosdenshion.so and it gets placed in the armeabi successfully. My .java file has the following libraries linked, and it doesnt complain about an errors…
I am using the same code between iOS and Android, and the iOS sound works perfectly. I am currently using cocos2d-x version 1.0.0… Suggestions as to where I am going wrong?
Maybe you should see an error in the DDMS perpersctive of your eclipse when you runn the apps, in that case, are your sound file in an appropriate format that your android device can read as well ?
Thanks for the info. I am VERY new to android development, and very unfamiliar with Eclipse. I wasnt even aware that the view you suggested existed until just now. Apparently I am doing something wrong since I see this about 100 times in my log.
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): error: This file can not be opened as a file descriptor; it is probably compressed
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): at android.content.res.AssetManager.openAssetFd(Native Method)
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): at android.content.res.AssetManager.openFd(AssetManager.java:314)
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): at org.cocos2dx.lib.Cocos2dxSound.createSoundIdFromAsset(Cocos2dxSound.java:143)
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): at org.cocos2dx.lib.Cocos2dxSound.preloadEffect(Cocos2dxSound.java:49)
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): at org.cocos2dx.lib.Cocos2dxActivity.preloadEffect(Cocos2dxActivity.java:169)
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native Method)
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:15)
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1112)
09-08 17:13:00.358: ERROR/Cocos2dxSound(216): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:975)
I am going to assume that compressed .caf files are not supported on android? If that is a correct assumption, what format is supported / should I use.
no worries,wav ,mp3,mod is fine for me.if i didnt list all supported sound ,but if you look in the sample provided in the ndk (native-audio) you will see a couple of different format.
the test case provided by the excellent team of coco2d-x can help as well