Android Question Saving variables for another day

Yves Mazzon

Member
Licensed User
Longtime User
Hi, I am developing a app where the user needs to add quite a few numerical variables. For now every time the user either press the back space or the home keys the variables display disappears and it is a pain to re-enter them. I would also like that those variables reappeared as they were enter the last time when the application is reopen for example another time or day. I suppose it means they will have to be save regularly when changed in a small file and the file re-open when the application is reopen. Do you have a simple example I could look at to see how it is done? Many thanks.
 

Eumel

Active Member
Licensed User
Longtime User
Why don´t use the search ? ;)
Why don´t take a look in Tutorials Section ? :)

There are many tutorials / examples about saving data in files and / or databases ..

Example THIS great tutorial from Erel

or THIS from klaus
 
Last edited:
Upvote 0

Yves Mazzon

Member
Licensed User
Longtime User
Why don´t use the search ? ;)
Why don´t take a look in Tutorials Section ? :)

There are many tutorials / examples about saving data in files and / or databases ..

Example THIS great tutorial from Erel

or THIS from klaus

Thanks Eumel, I hear you of what you are telling me. I'm still a beginner and I remember when I was learning VB or microprocessor languages there were always small examples to get you started and then you could get in in more complexity after you had understood the simple base. I had a look at Klaus and Erel I agree they spent a lot of time to explain how things work but what I can see it is for professionals and goes straight into complex form with long examples. I suppose it is not the place for me as simple beginner. What I just wanted is just a small example on how to save and retrieve my numerical data and not text or SQL from complex large applications.
 
Upvote 0

cyiwin

Active Member
Licensed User
Longtime User
I had trouble learning this stuff too. I think the material is great, programming for smart phones was new to me. I really like using the KeyValueStore module. It's a great way to store and retrieve variables from storage.
 
Upvote 0

Yves Mazzon

Member
Licensed User
Longtime User
Thanks everyone, I can do some work from there
I had trouble learning this stuff too. I think the material is great, programming for smart phones was new to me. I really like using the KeyValueStore module. It's a great way to store and retrieve variables from storage.

Thanks Cyiwin great stuff
 
Upvote 0

Yves Mazzon

Member
Licensed User
Longtime User
I had trouble learning this stuff too. I think the material is great, programming for smart phones was new to me. I really like using the KeyValueStore module. It's a great way to store and retrieve variables from storage.

Sorry for my ignorance but I cant find the way to add the KeyValueSore module. I added RandomAccesfile and Sql in my library manager but just don't find the KeyValueStore module. my B4A is registered ver 5.2. Many thanks.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
way to add the KeyValueSore module
Go to the library thread and download the lib
Copy the keyvaluestore.bas to your project
Add the module keyvaluestore to your project
Use it
 
Upvote 0

Yves Mazzon

Member
Licensed User
Longtime User
Go to the library thread and download the lib
Copy the keyvaluestore.bas to your project
Add the module keyvaluestore to your project
Use it
Thanks Don I copied keyvaluestore.bas from an exiting example given then saved it in my project. Where are the "library thread" to download the module. I look all over in the site and it is very confusing. Please give me the link where these can be downloaded. many thanks.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi Yves,

you can find the link in post #5 above. Exactly clicking at word KeyValueStore in phrase "I really like using the KeyValueStore module."

For your convenience I duplicate it here

udg
 
Upvote 0

Yves Mazzon

Member
Licensed User
Longtime User
Hi Yves,

you can find the link in post #5 above. Exactly clicking at word KeyValueStore in phrase "I really like using the KeyValueStore module."

For your convenience I duplicate it here

udg
Thanks udg, I must be dumb but is the module is the KeyValueStore.bas which I have already placed with my project folder and then load existing module using the commands: Project, Add Existing Modules and point to KeyValueStore.bas. ? Thanks for your time
 
Upvote 0

cyiwin

Active Member
Licensed User
Longtime User
The KeyValueStore is just a module. All you should have to do is go to Project > Add existing modules > browse to it and it will be added to your project. It does need to use libraries "SQL" and "RandomAccessFile" to work. Once added your working module will call on the subs inside of the KeyValueStore module as necessary.
 
Upvote 0
Top