Android Question Saving variables for another day

Discussion in 'Android Questions' started by Yves Mazzon, Sep 5, 2015.

  1. Yves Mazzon

    Yves Mazzon Member Licensed 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.
     
  2. Eumel

    Eumel Active Member Licensed 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: Sep 5, 2015
    DonManfred likes this.
  3. Yves Mazzon

    Yves Mazzon Member Licensed User

    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.
     
  4. GKCS

    GKCS Member Licensed User

  5. cyiwin

    cyiwin Active Member Licensed 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.
     
    Yves Mazzon likes this.
  6. Yves Mazzon

    Yves Mazzon Member Licensed User

    Thanks everyone, I can do some work from there
    Thanks Cyiwin great stuff
     
  7. Yves Mazzon

    Yves Mazzon Member Licensed User

    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.
     
  8. DonManfred

    DonManfred Expert Licensed 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
     
  9. Yves Mazzon

    Yves Mazzon Member Licensed User

    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.
     
  10. udg

    udg Expert Licensed 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
     
    DonManfred likes this.
  11. Yves Mazzon

    Yves Mazzon Member Licensed User

    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
     
  12. DonManfred

    DonManfred Expert Licensed User

  13. cyiwin

    cyiwin Active Member Licensed 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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice