Integration between cocos2d-x and some interesting java tools

Hi.

I know you guys already have too much work developing cocos2d-x, but I think I have to bring some points that in my opinion may prevent many people from using cocos2d-x.

cocos2d-x allow us to develop for Android in C/C++ language what is good but Android world is all around Java. It means that many wonderful tools are provided as Java code only.

Specifically, AdMob and Flurry.

I know it’s a matter of JNI calls and that in theory anyone that would like to use them should be able to do this integration on itself. The problem is that but most of users don’t know how to do these calls.

I’d like to ask you guys do develop two sample codes with this integration. So it would both ease adoption of cocos2d-x and help people to improve this integration.

I’m trying to integrate AdMob with cocos2d-x myself but I think my knowledge is not enough.

Regards.


Please,

Site

I think your problem is how to use JNI. Walser has asked me to write a document describes how to use JNI, but it is a big topic. I will collect some material of this topic and share it.

Hi, Miggo.

I’ve develop JNI in the paste (2001). At the time, Java was calling C functions. I never did the other way around: C functions calling Java.

I’ve already downloaded JNI documentation from Sun Oracle and I’m studying it.

Thanks.


Please,

Site

It’s not true, Java calling C native function and vice versa is working.

You can use JNI to call Java method from native C function without any problems.

I have integrated the Openfeint on this way, when you click a CCImageItem it will call Java method to bring up OF stuffs.

Try to find some JNI pattern, and you will get a lot help with that.

Simon Lin wrote:

It’s not true, Java calling C native function and vice versa is working.

@Simon You I think you didn’t understand what I wanted to say (probably because of my poor English) .

When I wrote:

I’ve develop JNI in the paste (2001). At the time, Java was calling C functions.

I just wanted to say that I’ve develop a JNI project in which only Java needed to access C functions. I didn’t need C functions accessing Java functions and because that I don’t now how to call Java functions from C.

I didn’t want to say that it wasn’t impossible to call Java from C.

Regards.


Please,

Site

@Simon By the way, have you successfully integrated admob with your games?

It would be nice if you wrote a tutorial explaining how to integrate openfeint (and admob) with cocos2d-x.

Would you mind to share these with us?

Regards.


Please,

Site

@Marcio, sorry for my misunderstanding.

As for the admob and OF integrating, I have already finished the OF integrating but still fight with admob.

I may write a step by step guide when I reached my goal to port this little game to the android platform.

Thank you.

No problem at all.

Your contribution will be very appreciated.

Thanks.


Please,

Site

Dear Marcio Andrey Oliveira:

You have my words, and here is the complete codes and guide.

http://www.cocos2d-x.org/boards/6/topics/5119

@Simon Lin Man thanks a lot for sharing.

It will improve adoption of cocos2d-x for sure.

Regards.


Please,

Site

Just posted a new topic about Flurry integration here - http://www.cocos2d-x.org/boards/6/topics/8518
Hope it helps

@Dmitry It definitely will be useful.

Regards.


Please,

Dear Simon , the link is 404 , do you have this material or can post again?

Thanks

Simon Lin wrote:

Dear Marcio Andrey Oliveira:
>
You have my words, and here is the complete codes and guide.
>
http://www.cocos2d-x.org/boards/6/topics/5119