Android NDK を使用して Android ゲームを開発しています。
50MB を超えるすべてのアプリについては、拡張ファイルが必要です。拡張ファイルのダウンロードとその存在の確認を実装しました。.obb ファイル内のファイルから読み取る必要があります。ネイティブ (C++) 側でこれを行うにはどうすればよいですか?
Android NDK を使用して Android ゲームを開発しています。
50MB を超えるすべてのアプリについては、拡張ファイルが必要です。拡張ファイルのダウンロードとその存在の確認を実装しました。.obb ファイル内のファイルから読み取る必要があります。ネイティブ (C++) 側でこれを行うにはどうすればよいですか?
チェックアウト<android/storage_manager.h>
- マウント、アンマウント、および obb ファイルのパスを取得するための関数があります。
/**
* Attempts to mount an OBB file. This is an asynchronous operation.
*/
void AStorageManager_mountObb(AStorageManager* mgr, const char* filename, const char* key,
AStorageManager_obbCallbackFunc cb, void* data);
/**
* Attempts to unmount an OBB file. This is an asynchronous operation.
*/
void AStorageManager_unmountObb(AStorageManager* mgr, const char* filename, const int force,
AStorageManager_obbCallbackFunc cb, void* data);
/**
* Check whether an OBB is mounted.
*/
int AStorageManager_isObbMounted(AStorageManager* mgr, const char* filename);
/**
* Get the mounted path for an OBB.
*/
const char* AStorageManager_getMountedObbPath(AStorageManager* mgr, const char* filename);
その後、通常どおりにファイルを操作できるようになります。