2015-04-18 23:20:41 +08:00
|
|
|
#include <jni.h>
|
|
|
|
#include <android/log.h>
|
|
|
|
#include "jni/JniHelper.h"
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
using namespace std;
|
|
|
|
using namespace cocos2d;
|
|
|
|
|
2015-11-27 17:00:33 +08:00
|
|
|
static std::string className = "org/cocos2dx/lua/AppActivity";
|
2015-04-18 23:20:41 +08:00
|
|
|
|
|
|
|
void setActivityPathForAndroid(const std::string& path)
|
|
|
|
{
|
2015-11-27 17:00:33 +08:00
|
|
|
className = path;
|
2015-04-18 23:20:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
string getIPAddress()
|
|
|
|
{
|
2015-11-27 17:00:33 +08:00
|
|
|
return JniHelper::callStaticStringMethod(className, "getLocalIpAddress");
|
2015-04-18 23:20:41 +08:00
|
|
|
}
|