1

I'm working on Cocos2dx project and facing with a problem! In cocos2dx, i can change data in assets folder to another path and my app can load texture and sound successfully.

This is my code in CCFileUtilsAndroid.cpp. It's work ok

bool CCFileUtilsAndroid::init()
{
    m_strDefaultResRootPath = "/mnt/sdcard/Testing/";
    return CCFileUtils::init();
}

But I want to read directly obb file without unzip it. I had to set this line into Cocos2dxHelper.java at init function.

Cocos2dxHelper.nativeSetApkPath(Environment.getExternalStorageDirectory()+"/Android/obb/com.example.test/Testing.obb"); 

But it's fail to load anything in obb file.

I read some solution in stackoverflow same as: Android OBB/ZIP loading (cocos2dx)

But i can't find solution for me. Please help me for this issue! Hope your reply! Thanks you very much

Community
  • 1
  • 1
  • You really need to provide more information.You aren't saying anything about thrown errors, etc. – GameDeveloper May 12 '14 at 15:08
  • I looked at this again and you wording of 'read directly obb file without unzip it' is confusing. You dont have to unzip it yourself, cocos2d-x had a function`getFileDataFromZip()` that would do the heavy lifting – GameDeveloper May 12 '14 at 21:21
  • Hi, I try to use getFileDataFromZip but i'm failure. I just want to load obb in cocos2dx. Do you have any solution or example code. Hope your help! – Tran Thanh Tuan May 20 '14 at 04:25
  • Hi, i finished to load obb file! I used solution with http://stackoverflow.com/questions/18573096/android-obb-zip-loading-cocos2dx Note: I used 2 lib support load obb by Google to load sound and music Google Play Licensing Library package Google Play APK Expansion Library package Thanks for your support! – Tran Thanh Tuan May 22 '14 at 04:54

0 Answers0