Hello.
I was hoping this would work for me, but it didn’t!
I’ve been beating my head against this one for awhile and hope that @vlads or someone can help. Here’s the facts:
(1) I have an app that uses “network.download”.
(2) The code works in the simulator and on my iPhone
(3) The code does NOT work on Android
(4) I can load the URL in a browser window on my Mac and using a browser on my Android phone
(5) The URL is:
https://graphical.weather.gov/xml/sample_products/browser_interface/ndfdBrowserClientByDay.php?whichClient=NDFDgenByDayLatLonList&listLatLon=44.112733%2C-73.923725&format=24+hourly&startDate=2022-06-03&numDays=4&Unit=e&Submit=Submit
(6) The file that returns from this is an XML file that I store locally in the “system.DocumentsDirectory”
(7) The file is returned, stored, read, and parsed correctly in the simulator and on my iPhone.
(8) On Android, when I look at “event.response” I get back an HTML formatted response that says the following:
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>
You don't have permission to access "http://graphical.weather.gov/xml/sample_products/browser_interface/ndfdBrowserClientByDay.php?" on this server.<P>
Reference #18.97ee2117.1654282553.75ff6ce
</BODY>
</HTML>
(9) I added an “xml” folder to my “AndroidResources / res” directory with a new file - “network_security_config.xml” with the following:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">graphical.weather.gov</domain>
</domain-config>
</network-security-config>
(10) The version of Solar2d that I’m using is: 2022.3673
(11) I have the following in my build.settings:
“android.permission.INTERNET”,
“android.permission.WRITE_EXTERNAL_STORAGE”,
“android.permission.READ_EXTERNAL_STORAGE”,
Help! Please! And thank you in advance. ~Keith