Closed GWRon closed 8 years ago
Having a look at sdl.mod/SDL/src/filesystem/android/SDL_filesystem.c, `GetBasePath()" can only return Null ... so it seems to do what it should.
You may want AndroidGetInternalStoragePath() instead?
Nope, I wanted to make "libxml" be able to load a file from the assets-folder ... so I wanted to get the absolute path to the file on the android device.
I used the internal one (which is the same as the Pref-one) to store my base.util.logger.bmx-log-files - and when using "LoadDirectory()" I only see this log-file in the internal storage directory.
Assume this is not possible as SDL directly loads from the APK. And as long as libXML does try to load it on its own, it wont do.
So I could try to circumvent it by loading the content via SDL and then feeding libXML with the string rather than the file.
Can't you load via a TStream and ReadDoc() ?
This is exactly what I tried to explain in the "circumvent"-phrase. Just having a google-look if there is an alternative. For now this is not that problematic, but if you imagine to have passed a bigger XML file (some MB) this means to have it completely stored in RAM when loading.
How so? If you are reading from a TStream you are reading it directly from some file.
Yeah but I have to load it to a string first (s:string = ReadStream("sdl::myxml.xml")
). Then I can pass this string to libXML's parseDoc.
Or have I misunderstood something?
Function ReadDoc:TxmlDoc(doc:Object...)
ReadDoc accepts a TStream, and should be able to load a TxmlDoc from it.
Will give it a try .. totally missed that part.
Short question: When using ReadDoc()
with an OpenStream()
-stream: when to close the stream? is after calling ReadDoc()
enough?
Yes, it should have finished loading it when the function returns.
Ok, Thanks ... having some crashes now, it is time to check your new SDL_Log()-functions
... Ok, loads the XML now on android. Thanks to SDL_Log() - and your help ;-)
Cool :-)
When using "GetBasePath()" on my android device I get the following
SDL_GetError()
-message:Application not compiled with SDL 2.0
The result is, that GetBasePath() returns an empty string (as
SDL_GetBasePath()
returns null)