Everyone do the OpenFeint

I am trying to implement OpenFeint, and even though I can login I get this error:

04-18 15:11:21.728: I/ActivityManager(96): Starting activity: Intent { flg=0x10000000 cmp=mygames.app/com.openfeint.api.ui.Dashboard (has extras) }

Scene.cpp
void HelloWorld::menuCloseCallback(CCObject* pSender)
{
OpenFeintAndroid::openLeaderBoards();
}

OpenFeintAndroid.cpp
static void OpenFeintAndroid::openLeaderBoards()
{

JniMethodInfo methodInfo;
if ( JniHelper::getStaticMethodInfo( methodInfo,
“nurogames/app/MyFeint”,
“openLeaderBoards”,
“()V”))
{
methodInfo.env~~>CallStaticVoidMethod;
methodInfo.env~~>DeleteLocalRef( methodInfo.classID);
}
}

MyOpenFeint.java
public static void openLeaderBoards() {
System.out.println(“Opening Dashboard”);
Dashboard.openLeaderboards();
}

As I said the initialization is correct, the login happens, the manifest was modified with the needed activities but no matter where I call that java piece (onCreate, Scene, somewhere else…) the app just miserably crashes. I have the OpenFeint test project in the same workspace and it works like a charm, so it is something c-related :frowning:

Also, secundary question. I have this java method _public static void openLeaderBoard(String idLeaderBoard)_, how should I call it with the JNIHelper? My solution does not work:

JniHelper::getStaticMethodInfo(
kJniMethodInfo,
“my/app/MyOpenFeint”,
“openLeaderBoard”,
“(Ljava/lang/String;)V”)

Hi.

There is a tutorial from Simon. You can see it here

He also wrote a post about JNI with cocos2d-x 0.12. It’s here.

Regards.


Please,

The text is not indented, commented, is project-specific and most of it is outdated and incoherent. That is why I am asking.

And the adbucks link is not classy.

Hi, F Es.

AFAIK The only guy that was kind enough to share how to connect to Openfeint using JNI was Simon.

I’m sorry if that information didn’t help you.

Maybe you could try to contact Simon and ask him for help. As cocos2d-x evolves I believe he updates its Openfeint code.

Regards.


Please,

UP to state that my problem is the same as this guy’s: http://stackoverflow.com/questions/9615899/change-activity-with-jni-call-or-using-openfeint-causes-app-crash

My app flow right now is as follows:
Cocos2dxActivity calls OFWrapper
OFWrapper creates OFHandler
cocos2dx starts scene
scene calls OFWrapper
OFWrapper (static) sends message to handler
Funcion gets called dynamically
(app crashes)

and it happens pretty much the same when calling OFWrapper functions from the main Cocos2dxActivity.