2010-04-16 41 views
15

我正在移植到Android。我現有的項目有大量的資源文件,我將其移植到我的Android項目中。我將它們全部放在/ res/raw /中,我想用我的本地庫中的函數(如fopen()等)訪問這些資源。可以這樣做嗎,還是我必須通過JNI才能做到這一點?爲了便於移植和可能的速度和內存原因,我真的不希望這樣做。在Android本機環境中從我自己的APK中讀取資源文件

回答

4

查看ndk中的obb.h。

從文檔/ STABLE-APIS.html在Android NDK:

<android/obb.h> 
     Direct (read-only) access to assets embedded in your .apk. or 
     the Opaque Binary Blob (OBB) files, a new feature of Android X.X 
     that allows one to distribute large amount of application data 
     outside of the .apk (useful for game assets, for example). 
相關問題