×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    280

    How to create persistence in app when performing some settings

    I am working on s40 app. I have created a time picker using spinners in s40 theme jar and when i close app i want last time i selected to be saved so that next time i opened my app i get the same selected time.

    How to do this.
    Last edited by Manpreet_Singh; 2013-08-27 at 11:55.

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: How to create persistence in app when performing some settings

    Simply save your settings either in RMS or File system (or Server if its a connected app and you have users id) and if your working with lwuit then you can use Storage (which uses the rms in the layer below)
    and then when your app is started check if that settings exists and use it otherwise use a default.

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: How to create persistence in app when performing some settings

    Quote Originally Posted by Manpreet_Singh View Post
    I am working on s40 app. I have created a time picker using spinners in s40 theme jar and when i close app i want last time i selected to be saved so that next time i opened my app i get the same selected time.

    How to do this.
    You can use RecordStore API's provided by MIDP to store your state Value in a recordstore - on every launch - try to read the value (on 1st launch you not get anything) on every exit - first save your values in RMS and then exit the app.

    Refer - http://developer.nokia.com/Community...t_System_(RMS)
    to know more about RMS in J2me.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  4. #4
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: How to create persistence in app when performing some settings

    I would recommend the Storage class out of the possible options suggested by Shai.It is fairy easy and straightforward to use .

    Code:
            Storage.init("myApp");
            .....
            Storage.getInstance().writeObject("SpinnerValue", value);
            .....
            Storage.getInstance().readObject("SpinnerValue");

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: How to create persistence in app when performing some settings

    If you are using in LWUIT in your project you can use Storage class from LWUIT to store such app properties - refer to: http://stackoverflow.com/questions/8...orage-in-lwuit

    for example on the same.

    But if you are not using LWUIT, you need to do it using RMS on your own.
    Last edited by im2amit; 2013-08-27 at 19:59.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  6. #6
    Registered User
    Join Date
    May 2013
    Posts
    280

    Re: How to create persistence in app when performing some settings

    Thanks shai,arunkam and im2amit

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,737

    Re: How to create persistence in app when performing some settings

    It is somehow mystical to see this question given that your arrived with RMS-related questions when joining these boards, and at least 1/3 of your discussions deal with RMS-related issues.

Similar Threads

  1. Replies: 1
    Last Post: 2013-06-21, 15:14
  2. how to programmatically create/edit sip settings???
    By chandantheracer in forum Symbian
    Replies: 44
    Last Post: 2010-08-26, 10:57
  3. How to create cascading settings list?
    By khamsasa in forum Symbian User Interface
    Replies: 4
    Last Post: 2009-02-03, 23:07
  4. How create Settings List?
    By Tanya in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-03-01, 11:37
  5. RNetDatabase and persistence
    By skornel in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2003-06-10, 16:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×