Пример #1
0
/* entry point callable from the Dalvik VM */
JNIEXPORT jstring JNICALL Java_com_mosync_STROPBenchNativeAndroidActivity_invokeNativeFunction(JNIEnv* env, jobject javaThis) {
	glob_env = env; //save the java environment
	glob_obj = &javaThis; //save the object that called us!
	StropBencher * sb = new StropBencher();
    sb->bench();
    delete sb;
//	return (*env)->NewStringUTF(env, "Done!");
}
Пример #2
0
/**
 * Entry point of the program. The MAMain function
 * needs to be declared as extern "C".
 *
 * Create a Moblet project to use the high level
 * MoSync C++ library.
 */
extern "C" int MAMain()
{

    StropBencher * stropbencher = new StropBencher;
    stropbencher->bench();

    /*MAEvent event;

    printf("Press zero or back to exit");

    while (TRUE)
    {
    	maWait(0);
    	maGetEvent(&event);

    	if (EVENT_TYPE_CLOSE == event.type)
    	{
    		// Exit while loop.
    		break;
    	}
    	else if (EVENT_TYPE_KEY_PRESSED == event.type)
    	{
    		if (MAK_BACK == event.key || MAK_0 == event.key)
    		{
    			// Exit while loop.
    			break;
    		}

    		printf("You typed: %c", event.key);
    	}
    }*/

    //free heap mem
    delete stropbencher;

    return 0;
}