Read app settings

Just starting out? Need help? Post your questions and find answers here.
AZJIO
Posts: 73
Joined: Wed Dec 14, 2022 1:13 pm

Read app settings

Post by AZJIO »

I would like to read and write application settings. Is there any ready-made example?
It is enough for me to read this one, the main thing is that the settings file can be manually placed where it can be read from.
I searched on the Internet and it says that the / data / data / folder is used, but access to it requires root rights. The user will not be able to copy the settings file to this folder. I looked at the XML example and didn't understand how to use it. The problem is where it reads the file from. Can anyone give a ready-made example, for example, to read the coordinates for a window? Or save the coordinates for the window.
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Read app settings

Post by Peter »

You can use the following code that emulates some preference commands of PureBasic: https://github.com/spiderbytes/Preferences
AZJIO
Posts: 73
Joined: Wed Dec 14, 2022 1:13 pm

Re: Read app settings

Post by AZJIO »

I would like to use XML because I want to store a list of users, and in the list of users, a list of alarms for each day. I think this is a complex structure and it would be more convenient to make it using XML.
plouf
Posts: 194
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: Read app settings

Post by plouf »

Thats tricky because by definition "webapp" has access to some internal storage of browser and not guaranteed to have access in the outside

Only "correct" way to import data from outside world is either by a file requster, and "upload" or via webserver
So if you can install a local webserver..is the best

Alternative if you to experiment without futureproof guarantee
You can play with chrome filesystem acccess api
https://github.com/GoogleChromeLabs/bro ... umentation
Christos
AZJIO
Posts: 73
Joined: Wed Dec 14, 2022 1:13 pm

Re: Read app settings

Post by AZJIO »

If I use OpenFileRequester(), can I open a file using a path in the phone without OpenFileRequester()?
I put the path "/strogate/emulated/0/Alarms/file.mp3" and opened with LoadSound() will it play? Similarly, a file with settings so that the program initially reads the file. If that doesn't work then I will use OpenFileRequester(). If there is no such path on another device, I would try to search for my file using some standard paths.
plouf
Posts: 194
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: Read app settings

Post by plouf »

No you canot read/write filesystem from within browser app without user to exlusively manualy select the file.

The ability to do it automaticallt is removed for security reasons long ago.
Only way is via local browser or chrome filesystem API
Christos
Post Reply