- Online Community Forums » Programming Questions » Filesystem access on android

This thread is locked; no one can reply to it. rss feed Print
Filesystem access on android
Member #4,372
February 2004

When writing an android app using allegro (NDK), i need to be able to write to the actual filesystem. I know that I can use al_android_set_apk_file_interface() and al_android_set_apk_fs_interface() to set the filesystem to the apk, but I need to be able to write to the actual filesystem to save my config files and to read user themes.

When trying to use al_path_cstr() on android without setting the apk file interface, the program segfaults.

How does one access the main/external flash?

Chris Katko
Member #1,881
January 2002

Does your program request, and have, permission to access the file system?

“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Member #358
May 2000

al_set_standard_file_interface otherwise to switch back

"Either help out or stop whining" - Evert

Member #4,372
February 2004

Nope it's returning nulls when I try and do anything with the "normal" filesystem. When I try and get a path, it segfaults

Here's my test program

== EDIT ==
I got it never mind

Edgar Reynaldo
Major Reynaldo
May 2007

Member #4,372
February 2004

Yea, I wasn't assigning test_path to anything. It's really tough to get meaningful errors out of an Android app. I use stdout/stderr to log my debug messages, and those are piped to /dev/null on the platform :(

Also it looks like the android version of allegro deson't support Android Video.

Go to: