Problem with external file location on Android

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

User avatar
Ats
Posts: 817
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Problem with external file location on Android

Post by Ats »

Yep, it's only "/assets/" in preview mode :wink:
User avatar
Kjell
Posts: 1928
Joined: Sat Feb 23, 2008 11:15 pm

Re: Problem with external file location on Android

Post by Kjell »

Hi Ats,
Ats wrote: Thu May 22, 2025 9:08 amYep, it's only "/assets/" in preview mode :wink:
Well .. that depends on what the desired behavior should be. In DOS & Windows a leading "directory seperator character" means that the path is "relative from the root of the current drive".

https://learn.microsoft.com/en-us/dotne ... -dos-paths

But obviously once you unify the behavior across various platforms, it's going to deviate from platform standards somewhere sooner or later :wink:

K
User avatar
VilleK
Site Admin
Posts: 2381
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Problem with external file location on Android

Post by VilleK »

What if we just changed the test for "/assets/" to "assets/" in ZPlatform_Android.inc. I have a feeling that would solve most issues.
User avatar
Ats
Posts: 817
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Problem with external file location on Android

Post by Ats »

Yeah, that's the simplest solution :lol:
I'll adapt the androidManifest afterwards.
User avatar
Ats
Posts: 817
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Problem with external file location on Android

Post by Ats »

I've made the changes to ZPlatform_Android.inc and all the ZGE.java files.
The file loading from `assets/` is now working on all platforms and preview mode.

I've seen those lines in the Docs\ExportAndroid.md :
169 3. Enable "Settings / Security / Unknown sources" on the Android device.
...
179
180 * `/assets/` for asset files, or
181: * `/sdcard/` for file on SD card.
The `/assets/` path should be reflected here. But I didn't try `/sdcard/` yet.
Post Reply