So I have some credits for my app and they are handled in HTML.
I have four files: credits.html , photos.html , credits.css , and reset.css. All four files are in the Assets/About folder which is right off the main folder with all the LUA files.
Because I might want to update the credits content without having to release a new version, I do a check and download updated content if it is on my web site. I use this code to load the content:
if doesFileExist( "credits.html", system.DocumentsDirectory ) and doesFileExist( "credits.css", system.DocumentsDirectory ) and doesFileExist( "reset.css", system.DocumentsDirectory ) and doesFileExist( "photos.html", system.DocumentsDirectory ) then creditsWebView:request( "credits.html", system.DocumentsDirectory ) else creditsWebView:request( "Assets/About/credits.html", system.ResourceDirectory ) end
When I disable Internet on my tablet and launch the app for the first time, the local credits.html loads, but without any CSS. In the HTML, the CSS is coded correctly, as such:
\<link rel="stylesheet" href="reset.css"\> \<link rel="stylesheet" href="credits.css"\>
So it should be loaded from the same folder. But it is not.
I then click the link to load the photos.html page, and I get this error:
The webpage at file:///data/data/com.thegdogentertainment.myappname/files/coronaResources/Asset/About/photos.html might be temporarily down or it may have moved permanently to a new web address.
The link is coded correctly, as such:
\<a href="photos.html"\>Photo and image credits\</a\>
So it should be loaded from the same folder, where it does reside, but it doesn’t.
If I enable Wifi and let it download the credits.zip file, which contains the exact same four files (with a text change so I can tell which set of files is loading), everything loads correctly and displays as expected from the system.DocumentsDirectory folder.
Why is the content not loading correctly from the system.ResourceDirectory folder on Android? Of course, it does work correctly in the iOS build 