You can copy the csv file from asset to ASD, then edit as text and save to asd
Now the question is: how can I synchronize the last version of the file from an external server and replace the old one automatically, possibly with a button? Many thanks for the help!
Yes, but as I said I need to upload and replace the csv file periodically without compiling the app every time.
Of course, if this file is hosted (updated) on a server, there is no problem accessing it as long as the device has internet access. So you/the user can download this file (to the ASD
or one of the Shared
folders) and access it if needed.
What about downloading the file on first run of the app from the internet? Same on button click?
Questions: The server always has the latest version? Which means, you only have to download the latest version? You do not have to upload the file from the app to the server?
Taifun
If the (new, updated) file is already available in the app (i.e. it was created by it), then why upload it to a server (and download it again)?
Probably because several user want to use the same data? I'm just trying to find out the requirements of the project to be able to provide a solution
Taifun
Ok, but which device would be the reference device then?
This discussion currently does not make sense... the requirements should be defined before we can suggest solutions
Taifun
OK. Sorry for the confusion. I want to point out that I’m not the author of the main topic, my question is only similar.
So let me be clear once again:
-
YES. my app should download the file from the internet on button click and should update the file that already have in itself (the file must be substitute and remain always there locally and available offline)
-
YES. the server always have the latest version
-
NO. I do not have to upload anything
But how does the user know when to press the button and when the Internet connection needs to be active?
In addition:
In case the existing file (in one of the Shared
folders) is to be replaced, this file must have been previously created by the app itself, at least on Android 11+. Otherwise it cannot be overwritten on Android 11+. Or the file must be stored in ASD or in PrivateDir (internal storage).
This means for example, that if the app was uninstalled and reinstalled, the existing file can no longer be overwritten on Android 11+ because it was then created by another app (namely the uninstalled app version).
In my case users don’t need to “know”. The button here should be an arbitrary function that just download the latest version of the file and substitute it. That’s all!
The only conditional test could be the availability of the internet connection, like this:
x = file
when Button.Click {
if (connection) {
download file y from server
substitute file x with y
alert: “file updated”
}
else {
alert: “connection failed”
}
}
Considering what you said about storing, ASD, etc. could you please help me to translate this logic with a little example in blocks?
Thank you so much for the patience.
In other words, the button must always be pressed in order to carry out any further action. (?)
No... the app has already a file in it and is fully functional. I need that "button" just to update/substitute that file when I want!
When you want or the user wants it?
When the user wants. I just communicate to him (in the real life) when a new file is released and uploaded on the server, so he can press that button.
A post was merged into an existing topic: 1) Read .csv file from phone, 2) Seach for a keyword 'Apple4321' 3) If keyword found, then look for the nearest word if it is 'send' 4) If the word 'send' is found do some action like 'play music'