I’ve been beating my head against this one for awhile and hope 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 I get back an HTML formatted response that says the following:
[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.
Reference #18.7fee2117.1654272202.49a15e42"
(9) I added an “xml” folder to my “AndroidResources / res” directory with a new file - “network_security_config.xml” with the following (not because I know what I’m doing with this file, but because I came across something similar in my search for a solution):
[?xml version=“1.0” encoding=“utf-8”?]
[network-security-config]
[domain-config cleartextTrafficPermitted="true]>
[domain includeSubdomains=“true”]https://graphical.weather.gov/[/domain]
[domain includeSubdomains=“true”]http://graphical.weather.gov/[/domain]
[domain includeSubdomains=“true”]graphical.weather.gov[/domain]
[domain includeSubdomains=“true”]graphical.weather.gov/xml/sample_products/browser_interface/
[/domain-config]
[/network-security-config]
(10) The version of Solar2d that I’m using is: 2022.3673
Help! Please! And thank you in advance. ~Keith
P.S. Note: I’m using square brackets to prevent HTML formatting. In the code above they replace angled brackets.