Skip to content

Instantly share code, notes, and snippets.

@midworld
Created July 22, 2014 02:58
Show Gist options
  • Save midworld/2b2626ee8aff52bdccac to your computer and use it in GitHub Desktop.
Save midworld/2b2626ee8aff52bdccac to your computer and use it in GitHub Desktop.
cocos2d-x plugin-x android class path
/** create the plugin by name */
PluginProtocol* PluginFactory::createPlugin(const char* name)
{
PluginProtocol* pRet = NULL;
do
{
if (name == NULL || strlen(name) == 0) break;
std::string jClassName = ANDROID_PLUGIN_PACKAGE_PREFIX;
if (std::string(name).find("/") == std::string::npos)
jClassName.append(name);
else
jClassName = std::string(name);
PluginUtils::outputLog("PluginFactory", "Java class name of plugin %s is : %s", name, jClassName.c_str());
PluginJniMethodInfo t;
if (! PluginJniHelper::getStaticMethodInfo(t
, "org/cocos2dx/plugin/PluginWrapper"
, "initPlugin"
, "(Ljava/lang/String;)Ljava/lang/Object;"))
{
PluginUtils::outputLog("PluginFactory", "Can't find method initPlugin in class org.cocos2dx.plugin.PluginWrapper");
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment