Example #1
0
bool Utils::checkPackageName()
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
    return true;
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
    std::string tmp = getPackageNameJNI();
    CCLOG("get     PackageName = %s", tmp.c_str());
    CCLOG("default PackageName = %s",PACKAGENAME);
    if(strcmp(tmp.c_str(), PACKAGENAME) == 0)
    {
        return true;
    }
    return  false;
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
	return true;
#endif
}
string CCFileUtils::getWriteablePath()
{
	// the path is: /data/data/ + package name
	string dir("/data/data/");
	const char *tmp = getPackageNameJNI();

	if (tmp)
	{
		dir.append(tmp).append("/");

		return dir;
	}
	else
	{
		return "";
	}
}
Example #3
0
bool Client::init(void)
{
	// screen
	m_uiScreenWidth      = 1024;
	m_uiScreenHeight     = 768;
	// client info
	m_sHardware         = ""; // iPad2,1
	m_sDeviceIdentifier = ""; // C1898E26-2F6B-50CC-9221-9350CF40DFDE
	m_sDeviceModel      = ""; // iPad
	m_sSystemName       = ""; // iPhone_OS
	m_sSystemVersion    = ""; // 5.1.1
	// bundle version
	m_sVersion          = "1.0";
	
	#ifdef getPackageNameJNI
	m_sPackageName = getPackageNameJNI();
	#else
	m_sPackageName = "com.beva.client";
	#endif
	return true;
}