The name of all files in DirAsset it seems to have been converted to lowercase by B4A, so I asked thatHe wrote it already. Yes.
No, it appears that the names of the files weren't converted to lower case. I did a ListFiles on DirAssests and the mp3's were all there in upper and lower. That was one of the things confusing me, because when I tried to load new, lowercase file names, Android said they were already there and didn't replace them. Very confusing.The name of all files in DirAsset it seems to have been converted to lowercase by B4A, so I asked that
The resource compiler converts names to lower case before processing to avoid problems on case-insensitive file systemsconverted to lowercase by B4A
It's weird, I don't think they are case sensitive in DirAssests, do you play mp3 that is in DirAssets?No, it appears that the names of the files weren't converted to lower case. I did a ListFiles on DirAssests and the mp3's were all there in upper and lower. That was one of the things confusing me, because when I tried to load new, lowercase file names, Android said they were already there and didn't replace them. Very confusing.
Yes. The action of the program is working fine. A button which activates an mp3 from DirAssetsIt's weird, I don't think they are case sensitive in DirAssests, do you play mp3 that is in DirAssets?
I don't understand what you mean, why said they were already there and didn't replace them.when I tried to load new, lowercase file names, Android said they were already there and didn't replace them.
They were already in DirAssets as upper and lower case, but when I renamed them in the program to be all lower case, then reran the program, Android saw the names in DirAssets - the upper and lower case ones - as being the same as those in the program - the lower case ones. And because it thought they were the same it didn't bother replacing the ones in DirAssets. That is the final point of my original post; in order to clear them out of DirAssets, I needed to turn the phone off then back on. That cleared DirAssets of the upper and lower case mp3's, allowing the new lower case ones to be written to DirAssets when I ran the program again.I don't understand what you mean, why said they were already there and didn't replace them.
The mp3 modules are hard coded in the program. Button 32 uses abc.mp3. The name of the modules was a tad convoluted when I downloaded them, but the module's use was coded into the name, so I didn't change it. The only change I made was to change all upper case to lower case .... in the program files and in the program. The final step was to remove them from DirAssets, as discussed above.Rename, how do you do rename?
Thank you for sharing the solution.The mp3 modules are hard coded in the program. Button 32 uses abc.mp3. The name of the modules was a tad convoluted when I downloaded them, but the module's use was coded into the name, so I didn't change it. The only change I made was to change all upper case to lower case .... in the program files and in the program. The final step was to remove them from DirAssets, as discussed above.
In simple words, yes. The rename of the mp3 modules was done on the laptop, not within the program. Of course, all references to them in the program needed to be made lower case, but that wasn't how I changed the names. It was simply a case of renaming every one in the laptop folder, then adding them to the program in the standard way.Thank you for sharing the solution.
I couldn't find rename method in File, so I was curious to ask you how do rename, after read this, I guess it is that copy mp3 to another folder then delete it from assets, is that?
You know that DirAssets is read only, don't you? You can't rename, or change any files there, within the app.They were already in DirAssets as upper and lower case, but when I renamed them in the program to be all lower case, then reran the program, Android saw the names in DirAssets - the upper and lower case ones - as being the same as those in the program - the lower case ones. And because it thought they were the same it didn't bother replacing the ones in DirAssets. That is the final point of my original post; in order to clear them out of DirAssets, I needed to turn the phone off then back on. That cleared DirAssets of the upper and lower case mp3's, allowing the new lower case ones to be written to DirAssets when I ran the program again.
I certainly do now, that's for sure. Now it is clear that also includes replacing existing files in there, or deleting files from there, hence the need to turn off the phone to clear it. The main point of this post was to highlight the confusion that can come from Android not accepting upper and lower case and the weird way it handles it. So long as people know about this potentially confusing situation, they'll know what to do if their files aren't working. Rename them on the laptop to all lower case, then turn the phone off and back on. Run the program again from the laptop and it will reload the renamed files and Android will handle them correctly.You know that DirAssets is read only, don't you? You can't rename, or change any files there, within the app.
Excellent idea. Thanks for the suggestion. I did a similar trick for my home-grown WORDLE program. Not DirAssets, but a place that makes it very convenient.Not directly related, but you might find its better to put the names of all files you want to use in a list, adjusting cases as needed. Put the file list in DirAssets too, and then read that first. That way you dont have to hard-code filenames in your code. Much more flexible.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?