How can I get hold of AAssetManager?

125 views
Skip to first unread message

Vladimir Roth

unread,
Jan 15, 2014, 11:39:30 PM1/15/14
to apportabl...@googlegroups.com
I'm trying to get file access working as my Obj-C app loads textures/shaders/sfx directly from files.

I can't seem to figure out how to get hold of AAssetManager so I can access these files on Android. I use fstream in the iOS version of the game.

 I found some threads here that are mentioning [AndroidActivity currentActivity] which will give me current activity, but I don't know how to translate that into ANativeActivity, so I can get handle to asset manager. There does not seem to be any mention of file access in the documentation either. Makes me wonder how is everyone else loading their resources??

I never developed on Android before so any feedback that will point me in the right direction is much appreciated.

Thanks,
v

Philippe Hausler

unread,
Jan 15, 2014, 11:40:33 PM1/15/14
to apportabl...@googlegroups.com, Vladimir Roth
The latest push of the SDK 1.1.02 should have the previous methods you were needing.
--
You received this message because you are subscribed to the Google Groups "Apportable discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Vladimir Roth

unread,
Jan 15, 2014, 11:44:25 PM1/15/14
to apportabl...@googlegroups.com, Vladimir Roth
Tried it just now and still getting one error complaining about MB_CUR_MAX_L.

scons: Building targets ...
Compiling /Users/vladimirroth/iPhone/BikeBaron/Trunk/xt/renderer/xtFonter.cpp
clang: warning: argument unused during compilation: '-X_CHECK_RANGES'
In file included from /Users/vladimirroth/iPhone/BikeBaron/Trunk/xt/renderer/xtFonter.cpp:12:
In file included from /Users/vladimirroth/.apportable/SDK/System/fstream:169:
In file included from /Users/vladimirroth/.apportable/SDK/System/ostream:132:
/Users/vladimirroth/.apportable/SDK/System/locale:228:10: error: use of undeclared identifier 'MB_CUR_MAX_L'
decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>()))
         ^
/Users/vladimirroth/.apportable/SDK/System/locale:232:10: error: use of undeclared identifier 'MB_CUR_MAX_L'
  return MB_CUR_MAX_L(__l);
         ^
2 errors generated.
scons: *** [Build/android-armeabi-debug/ms.games.bikebaron/Users/vladimirroth/iPhone/BikeBaron/Trunk/xt/renderer/xtFonter.cpp.o] Error 1
scons: building terminated because of errors.
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-discuss+unsub...@googlegroups.com.

Philippe Hausler

unread,
Jan 15, 2014, 11:54:40 PM1/15/14
to apportabl...@googlegroups.com, Vladimir Roth, Vladimir Roth
can you provide a usage case? because the basic usage seems to be working for me
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.

Vladimir Roth

unread,
Jan 16, 2014, 12:07:03 AM1/16/14
to apportabl...@googlegroups.com, Vladimir Roth
I'm on OSX (10.8.5) and only thing that I'm setting defferently than defaults is in configuration.json file, where I have "defines": {"__APPLE__": 1}. This is because of PVRSDK files that would not compile otherwise as they're for OSX platform.

Then in the actual .cpp file I just "#include <fstream>" and that's where the compilation throws error.

And then reading the file.

std::ifstream file(fileName);

if (file.is_open())

{

char buf[1024];

file.getline(buf, sizeof(buf)); parseFontHeaderLine(buf);

...
Reply all
Reply to author
Forward
0 new messages