Had built a KWGT widget that displayed the current weather via an icon. Just recently had to get a new phone and did not properly export my project. Having to rebuild the widget from scratch.
Before, I was using this command to display the current weather icon:
When we hard code the file path, it would be specific to a storage location. So, it will be failed to load in a different storage location.
As far as I know, several devices name its internal storage as “storage”, several others name theirs “sdcard” or something else.
So, the best practice is too embed each of the required images into the preset using Global Variables (choose the Bitmap variable type), then use the $gv(…)$ function to access it.
Here’s the suggestion to use the global variable to get the corresponding image:
$gv(wi(icon)+ai(isday))$
Each global variable should be named in the following format:
[weather_icon_codename][0|1]
For example:
pcloudy0 ➞ contains the bitmap data of the Partially Cloudy in nighttime style
pcloudy1 ➞ contains the bitmap data of the Partially Cloudy in daytime style
haze0 ➞ contains the bitmap data of the Haze in nighttime style
haze1 ➞ contains the bitmap data of the Haze in daytime style
Thank you for the suggestion. It did not remedy my situation. The path is correct. The strange thing is the text being displayed corresponds with the correct weather condition. However, I want the image to be displayed rather than text.
Are you sure KWGT has permission for the folder?
A while back an update (or new version?) of Android forced the need to have very specific permission(s) to access the folder.
I went to settings, then general settings, and looked at the Main Storage section. It is set to the correct location. Does that give the permission the app needs to access the files?