×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    3

    Smile RecordStore in WRT?

    hi all

    Is there a way to store information in a safe way on a mobiledevice using WRT. In JavaME I used RecordStore but I can't find anything about RecordStore management in WRT.

    Does WRT support this? Or is there an alternative?

    Maybe by creating a file which contains the information? but the user could delete this file by accident :s

    Greetz

    Stephan Celis

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: RecordStore in WRT?

    check the settings storing thing: http://wiki.forum.nokia.com/index.ph...ettings_in_WRT

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    3

    Re: RecordStore in WRT?

    I looked into this but i Noticed that the setPreferenceKey() function expects a String to store

    I need to store an array (from favourite destinations)
    I could put it all in a very long string with for examble ";" as seperator
    But then I'm limited in the length of the string, this array could become quite large over time.

    Do you know something to solve this?

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: RecordStore in WRT?

    I'm not aware of any other savings method really,

  5. #5
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: RecordStore in WRT?

    Quote Originally Posted by stece View Post
    I looked into this but i Noticed that the setPreferenceKey() function expects a String to store

    I need to store an array (from favourite destinations)
    I could put it all in a very long string with for examble ";" as seperator
    But then I'm limited in the length of the string, this array could become quite large over time.

    Do you know something to solve this?
    How about using one key to hold the array of another keys?

    Like:
    setPreferenceKey("placnameA;placenameB", "placenames"); and then splitting the huge (it must be a huge if it does not fit in one string) array into smaller sections e.g. by starting alphabet.
    setPreferenceKey("Andorra;Alabama", "placnameA");

    You might also want to consider using JSON as format instead of csv.
    -Ilkka

  6. #6
    Registered User
    Join Date
    Jan 2010
    Posts
    3

    Re: RecordStore in WRT?

    So I've written the following 2 functions

    'FavorieteRouteOpslaan' should save the two paramaters as a preference key using a long String.

    'getFavoRoutes()' should get all the information and print it on the page in a <div> container

    However my page only displays 'undefined'.

    i know there is something wrong in the last function but I can't figure it out :s

    I hope the dutch names don't cause too much confusion :P

    Code:
    function favorieteRouteOpslaan(vertrekplaats,  bestemming){
    	var strBestemming = document.getElementById(bestemming).value;
    	var strVertrekplaats = document.getElementById(vertrekplaats).value;	
    	var routesString = widget.preferenceForKey("FavoRoutes");
    	routesString += strVertrekplaats + ":" + strBestemming + ";"
    	widget.setPreferenceForKey(routesString, "FavoRoutes");
    	showContainer("FavorietenContainer");
    }
    
    function getFavoRoutes(){
    	
    	var routesString = widget.preferenceForKey("FavoRoutes");
    	var routesArray = routesString.split(";");
    	var eindString = "";
    	
    	for (var i = 0; i < routesArray.length; i++){
    		var tempArray = routesArray[i].split(":");
    		if (tempArray.length == 2) {
    			var strVertrek = tempArray[0];
    			var strBestemming = tempArray[1];
    			eindString += "<br />Vertrekhalte: " + strVertrek + " bestemmingshalte: " + strBestemming + "/";
    			
    		}
    	}
    	document.getElementById("FavoRoutesContainer").innerHTML = eindString;
    }

  7. #7
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: RecordStore in WRT?

    You may want to check the return value of widget.preferenceForKey("FavoRoutes");
    It will return "undefined" if there is no value for that particular key.

    -Ilkka

Similar Threads

  1. RecordStore bug on Series 60
    By ncerezo2 in forum Mobile Java General
    Replies: 21
    Last Post: 2009-11-26, 10:12
  2. Replies: 14
    Last Post: 2009-02-16, 14:40
  3. What is WRT 1.0, 1.1, 1.2 versions?
    By naroori in forum Symbian
    Replies: 2
    Last Post: 2008-12-24, 20:07
  4. Forum Nokia WRT Webinar Q&A (In Portuguese)
    By bill.volpe in forum Symbian
    Replies: 0
    Last Post: 2008-06-13, 16:35
  5. J2ME Nokia 6263 RecordStore issue
    By jbaisden in forum Mobile Java General
    Replies: 0
    Last Post: 2008-02-20, 05:28

Posting Permissions

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