Preference shared or persistent storage on BB10

Hello

I want to store some information about the phone's memory. Is a persistent storage or shared present on the BB10 preferably?

Hello

Yes.  You can use QSettings. For more details, see example StarshipSettings.

https://developer.BlackBerry.com/Cascades/sampleapps/

Tags: BlackBerry Developers

Similar Questions

  • Host system logs are stored on non-persistent storage

    After the upgrade of a crowd of ESX4.0 at ESXi5.5, I get 'host system logs are stored on non-persistent storage. I've now changed the location of the log of a shared data store. What happens if this datasore is offline due to a mistake or an interview?

    you will get the error like "" /var/log/.vmssyslogd.err: unable to write the newspaper "that's all." then you will have loss the logs after this time. in order to configure it in drive clean. FYI: this always used to use diagnostic logs, it is important

  • Hi guys. on the macbook in System Preferences > sharing there is a box at the top that says "computers on your local network can access your computer at:" means that other people can access my computer?

    Hi guys. on the macbook in system preferences > sharing there is a box at the top that says "computers on your local network can access your computer at:" means that other people can access my computer?

    "Your local network" is the computers that are on the same router as you. At home, this is your family.

    to: "computer name" is the name of the computer, they will see.

    Access is provided for items you decide to activate, usually file sharing. For sharing of files, ONLY the items that you specify in the file sharing dialog box details panel is accessible and be only users you EXPLICITLY list by username.

  • Store the object in a persistent storage

    Hello

    I want to store the cusom object in the persistent store.here is my custom class:

    public class {UserData

    OrgName string;
    Time to string;
    String authTocken;
    Public UserData (orgName, String authTocken, String time, String)
    {
    this.orgName = orgName;
    This.Time = time;
    this.authTocken = authTocken;

    }
    public String getOrgName() {}
    return orgName;
    }
    {} public void setOrgName (String orgName)
    this.orgName = orgName;
    }
    public String getTime() {}
    back in time;
    }
    {} public void setTime (string time)
    This.Time = time;
    }
    public String getAuthTocken() {}
    Return authTocken;
    }
    {} public void setAuthTocken (String authTocken)
    this.authTocken = authTocken;
    }

    }

    and I use the following class of persistent storage to store the data.

    / public final class PersistentStoreContents implements {Persistable
    private CAMailMinderHashTable mElements = null;
    static private instance of PersistentStoreContents = null;
    Private static final long KEY = 0x67c5b66a2bcd1dfcL;
    private PersistentObject persistentObject = null;

    /**
    * Gets the single instance of the database.
    *
    * only @return of the database instance
    */
    public static getInstance() {} PersistentStoreContents
    try {}
    If (instance == null) {}
    Logger.out ("PersistentStoreInfo", "creation of the storage object");
    instance = new PersistentStoreContents();
    }
    } catch (Exception e) {}
    instance = null;
    }
    return instance;
    }

    private PersistentStoreContents() {}
    persistentObject = PersistentStore.getPersistentObject (KEY);
    synchronized (persistentObject) {}
    If (persistentObject.getContents () == null) {}
    persistentObject.setContents (new CAMailMinderHashTable());
    persistentObject.commit ();
    }
    }

    mElements = persistentObject.getContents ((CAMailMinderHashTable));
    If (mElements == null) {}
    Logger.out ("PersistentStoreInfo", "*" + (mElements is nothing));
    mElements = new CAMailMinderHashTable();
    }

    }

    public String getElement (String key) {}
    Logger.out ("PersistentStoreInfo", "getElement:" + key);
    Return (String) mElements.get (key);
    }

    ' Public Sub setElement (String key, String value) {}
    Logger.out ("PersistentStoreInfo", "setElement:" + key + value);
    mElements.put (key, value);
    persistentObject.setContents (mElements);
    persistentObject.commit ();
    }

    UserData public getElement2 (String key) {}
    Logger.out ("PersistentStoreInfo", "getElement:" + key);
    Return mElements.get (key) (UserData);
    }

    public void setElement2 (String key, UserData userData) {}
    Logger.out ("PersistentStoreInfo", "setElement:" + key);
    mElements.put (key, userData);
    Logger.out ("PersistentStoreInfo", "added");
    persistentObject.setContents (mElements);
    Logger.out ("PersistentStoreInfo", "game content");
    persistentObject.commit ();
    Logger.out ("PersistentStoreInfo", "Validate");
    }

    Public list getAllKeys() {}
    Logger.out ("PersistentStoreInfo", "getElement:" + key);
    Return mElements.keys ();
    }
    }

    I use the follwinng code to insert data :

    PersistentStoreContents ch = PersistentStoreContents.getInstance ();
    UserData = us new UserData("gmail.com","1111","aaaa");
    ps.setElement2 ("[email protected]", US);

    But it is not inserting data in the persistent store. App is struck to the persistent store setContent method... any idea on this?

    the object you put in the store has implemented persistable, not your utility class.

  • When to use a persistent storage?

    Hi all

    I have created applications that use the persistent storage, and I created applications that use a SQLite database.  I also have applications that use both.  My question is this:

    Persistent storage should be limited to what it stores?  For example, should persistent storage serve more for purposes of storage of simple things like "font size selected user for the application" and "a hash of default language table and its code of language of the application"?  Alternatively, could also be recommended to act almost like a database, for example when a user does not have an SD card installed - in which case store you several vectors of objects and others?

    Is there a possibility of persistent storage is only not available due to limited space?  For example, if the user has a large number of other applications that use the persistent storage?

    Finally, I believe that persistent storage is only erased in the event of a battery pull, etc..  Is it also possible to delete in other ways, like a reboot?

    Thank you!

    I look at the characteristics of the data I store and the characteristics of the options (SQLite, folder on card SD or PeristentStore) and make a decision on this basis.

    The highlights for me are

    (a) the size of the data

    (b) requirement of presence

    (c) the use of the data

    (d) deletion of data

    Working through these:

    (a) size

    There is a reasonable amount of available devices, as well as more than PeristentStore.  If you have a vector of strings of 10,000, each 100 bytes long, it's always only! MB of storage.  And there are managers of low storage that you can listen to and store your use of the PersistentStore.  But there is more space on an SD card, and no chance to shake the Blackberry is that you use up too much memory (if you use PersistentStore the unit clears things like the old emails that can disrupt your users).

    (b) requirement of

    Don't forget that your users can remove the SD card and all data

    (c) the use of the data

    If the data lends itself to using an object of mode, it seems an appropriate way to store it in this form, which means that there is no "Serialization" required to make it a flat file or the conversion into a table.  But things like images, audio files and gain no advantage being stored as object.  So stick them on the SD card.

    (d) remove

    PersistentStore is deleted when the application is removed, which can be a good thing.

    In summary, there is no right answer here, use the best option for the job you have.

    With regard to your questions:

    "Is there a possibility of persistent storage is only not available due to limited space?

    Yesish, as mentioned, it is the low Storage Manager.  But to be honest, you can store megabytes of data in a table like structure in PersistentStore, and as long as you're careful, it will work fine.

    "I think that persistent storage is only erased in the event of a battery pull.

    No, it remains on a battery pull.  To clear, regular forms are to wipe the device, or remove the application that uses it.

  • Register a class in a persistent storage?

    I have a class with many defined configuration variables. These are defined during execution. Is it possible to back up and recover the class in a persistent storage? If so, how?

    The situation you are trying to encode to is easily manipulated with permanent storage.

    If you look at the works of persistent store, you basically store an object in a persistent crack, which is identified by an ID - the ID is along the value.  Anyone who knows the ID can access the object.

    However, to interpret the object, they must have the exact class which was used when the object was stored.  In your case, it's easy as your two 'Applications' will actually use the same class that they are actually just different entry points into the same set of code.

    This requirement for the same class to use, becomes a problem when you have two totally different applications using the same persistent ID.  In this case, both applications have to share a class library that defines the persistent object.

    But back to your situation, what you're trying to work with persistent store.

    To give you more feeling for her, if your application asks the persistent object, it gets a reference to an object in the flash memory.  When your GUI application did the same thing, he will get a reference to the same object.  Then they will certainly share data, and consider it both one and other updates.

    Hope that clears it for you.

  • store integers in a persistent storage

    Hi all - I'm being a key on this one I don't know. The SDK V5. Have a persistent storage object that contains an integer. If its creation as:

    persistentHashtable.put ("GPRSUpdate", New Integer (180)); in a few seconds

    Now have an editsettings (behind a login screen) screen which displays the value and allows it to be updated using an editfield. I am then convert the integer to a string and then add it to the ediitfield as follows:

    If (persistentHashtable.containsKey ("GPRSUpdate")) {}
    Integer gprsInt = (Integer) persistentHashtable.get ("GPRSUpdate");
    testInt int = gprsInt.intValue ();
    String testString = Integer.toString (testInt);
    editGPRSUpdateInterval.setText (testString);
    }

    so, which works very well. The problem is that I can't save a change and then log in to the screen later without the bombing with a classcastexception error application. The problem, I'm sure that resides in the code that performs the backup that is as follows:

    public void saveOptions() {}
           
    String gprsUpdated = editGPRSUpdateInterval.getText ();
    int savegprsInt = Integer.parseInt (gprsUpdated);
            
    persistentHashtable.put ("GPRSUpdate", New Integer (savegprsInt));
        
    persistentObject.commit ();

    }

    Can someone please explain tp starting it what is the problem? I don't know that its confused me again between objects and data types, but if someone could point out where I'm wrong it would be appreciated. See you soon

    Nothing wrong with this code that I can see.

    Can you tell us the line that throws the exception of cast.  What kind of object you actually have (debugger should find that).

  • Persistent storage problem

    Hi all

    I use a persistent storage to store my data.

    Question: Persistent data are automatically get updated while recovery of persistence data and store it in a variable local object and then modify this local variable, observe that the persistent data are also changed without saving my new changes.

    I'm storage array of user defined class in persistent for example myclass [];

    I used to store vector which has been also get updated so I have changes to my class, I'm storage table because I store the list of objects of 'MyClass '. By changing the vector in [myclass] problem has been solved, but now I'm getting same result once again.

    I create a listener in the background that will read persistent data and send only data used to my application in the foreground, but when I do some changes in my local object again once it finds that the data gets reflected in persistent.

    Please let me know what I am doing wrong. I created a library of my persistent classes so that the foreground and background the two application could access.

    Looks like my storage

    Class Myclass implements persistable

    {

    certain types of data from premitive

    MyClass2 [] arrayOfSecondClass;

    }

    class Myclass2 implements persistable

    {

    certain types of data from premitive

    Myclass3 [] arrayOfThirdClass;

    }

    class Myclass3 implements {persistable

    Some data from premitive

    }

    //////////////////////////////////////////////////////////////

    call persistent to save and retrieve data:

    Thank you Peter and James,.

    It's corrected now. Your example simple singleton helped to understand the major concept.

    Kind regards

    Aparna Bloe

  • initialization of a whole white in a persistent storage

    HI - can someone put me out of my misery with this toddler please. With the keys v 5 SDK. All I want to do is create an empty new integer into an object of persistent storage for use at a later date (like creating a string empty). If this code does not work, but I don't know how to get around:

    persistentHashtable.put ("Test", New Integer());

    error message says integer (int) in java.lang.Integer cannot apply to (), so presumably you can't initalise it without specifying a value. I want not initialized with the value 0 because it is a value - all that I want is an empty integer. Quotes does not work, does not have null - help pls?

    There is no value 'undefined' for the entire object as you found it.

    The two options that come immediately to mind are:

    (a) create an extended integer that supports a parameter "blank".

    (b) use null to indicate this.

    (b) means not having a value in the hash table - so no value indicates an empty integer.

  • Workaround for storing persistent objects I have persistent storage?

    I am storing configuration of sorts data in the persistent storage XML definitions and other data of type string.

    These data are read from a server when the application is installed and can also be requested by the user.

    It is stored in a hash table for the simple extraction and hash tables are saved in persistent storage, works well.

    Except for storing images that come in the format of png og files are not persistables. Who discovered the way lasts :-)

    Is there a way around this problem? All this data is delivered in a zip file from the server and everything is unpacked on the SD card. So is it possible to "turn" or "wrap" these png files so they can be stored in a persistent storage? Save them on the SD card are ok for temporary storage, but for 'permanent' storage, I like to keep in a persistent storage.

    arrays of bytes must be persistent.
    You can use http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/EncodedImage.html#getDa... to get bytes from an image, and you have already mentioned how to get it back.

    store in sqllite work similar.

  • Local persistent storage takes a long time

    Hi all

    I created an application in which I store locally 1,200 objects (employee information) using the persistent storage of BB model.  For each object store, I have 7 attributes: name, phone, address, email, mobile, area and position. I store this information that once (the first time, the application is launched), but this activity takes about 4 minutes to complete, I think it's a lot of time. Does make sense or I may do something wrong (not effective)? Is there another mechanism to store information on the spot which is the more efficient/FAST?

    Best regards

    Juan.

    It is normal that it takes so long, do so in a separate thread or display a progress on a splash screen bar illustrating indexing.
    If it needs to be done that only once the time needed is not very important IMO.

  • removeAllelement() method of the vector to remove persistent storage data

    Hello

    I store a vector in the persistent storage when I use removAllelement() vector method to remove all elements from the vector, this command deletes the data from the device of storage.why persistent, behaves like this. I use blackberry 8900 OS 4.6.1.

    the stored object is the same, you are currently handling. If another application is running a validation on a persistent store shops are kept and your empty vector is written in the persistent store, even without you commitment.

    You can copy the stored vector If you want to change it without changing the stored one.

  • Update of persistent storage and application

    Hi all

    is there a way to keep the persistent storage when I update the application on the device/Simulator? At the present time, I have to remove my storage before persistent that I have send a *.cod on the device/Simulator update, otherwise I get the javaloader message that the module is still in use.

    Kind regards

    Carsten

    Yes, and it works. I guess the behavior of everything that I experience is according to the design, in fact, that it makes sense, I have to admit.

    Conclusion:

    Without a persistent store, you can load and delete modules as you want without reinitialization.

    With a store persistent activity the reference must be resolved in a controlled manner, allowing RIM only via a reset after downloading the updated application. Delivery to zero then correctly replaced the old app of the new application and allows access to the preserved persistent store.

    I hope that my conclusions are correct. However, it is inconvenient because the sim card reset takes quite a long time...

    Thanks for your time, LWG!

    Kind regards

    Carsten

  • Use a persistent storage or other methods to synchronize

    I have a user interface class that communicates with a background class by sending commands with world events to the base class. Two of them also uses a persistent storage.

    A simple method to retrieve return values could be to use a persistent as this storage:

    The user interface does:

    1 clears the back entrance in a persistent storage

    2 send the world event.

    3. going in a loop with a Thread.sleep and check if the back entrance is always empty

    After a number of loops decides that no response will be provided.

    The background task does:

    1 housing starts by accessing persistent storage in order to block with synchronization

    2 performs at the request of action

    3 put the result in the return of persistent storage field

    4 out of sync

    It sorts of handset return results and waiting for results. If the background task is not there the user interface will break out of the loop with a blank back. The only uncontrolled situation would be if the background task fails

    along the way, but then I have other problems. I threw an eye to wait/notify, semaphores and others, but the easiest solution is to use a persistent storage, because it has been used in any case for return information.

    Or expertise in this forum suggest another approach?

    A single Thread.yield is very good indeed, but if you put the user interface in a loop, just treatment Thread.yield () and the test for completion, instead of blocking your Thread event you will be hogging your event Thread and the operating system can get mad that too.

    As to notify the Ui that a message has been processed, Yes, the Observer Interface to do this.

  • Error in persistent storage when the application update that happened.

    I've been struggling with the problem for a long time.

    MY application uses a persistent storage to store parameter information.

    But when I update my application from version 1 to version 2, number of items in my configuration page has been changed, which means the new version of the page layout will load and save some new stuff in a persistent storage that did not exist in the old persistent storage.

    Problem occurs when custorms update their request. How can we drag all the old stored information when users start to use the updated application?

    I see these three options:

    (a) the best thing to do is to delete the old application, which will get rid of the old persistent data.

    (b) create a 'version2' of you persisted object with a different name.  In your treatment of startup, you see if there is a version 1 object, and if so, migrate the setting of the object Version in 1 to your new object.

    (c) try to your compatible changes.  There are different ways to do this.  A way that is easy to understand is to persist a string, which is your options encode in XML format.  If you use an XML string, then you can add a new attribute to your new options - but the persistent object remains the same.

    I hope this helps.

Maybe you are looking for

  • Open in the timeline

    When you use FCPX, I right click on an item in a project to "open in timeline" once it opens in its timeline, the video in the Viewer is black, I see the clip in the timeline itself, it has a sticker on it, but I can't see the video in the Viewer. Do

  • Pavilion g6-2306el: life of the battery and using the laptop all day

    Hello I tend to use the laptop for work almost all day. If this is the case, she recommends simply detach the battery, instead of always keep at full load (since it has plugged all the time)? Thank you.

  • Print scan the service of HP Pavilion dv6 finger does not

    Not had problem until I installed updates on hp support assistant. Now, only time will Flash next to him is to reboot and when I try to scan it says Error preventing the use of fingerprint credentials. never lights up at any time. I dv6-6117dx, runni

  • 0x8024400a error

    Ho la formattare he e Pc ho reinstallato windows XP (procedure gia fatta altre volte senza problemi), my quando tento di cercare aggiornamento tramite gli updated windows, of mi

  • question about UEFI

    Hello I read on UEFI and I see it has many advantages, it is supported to drive more than 2.2 terabytes. My question is should I take action when I install windows 7 or 8 on a computer of frmware UEFI. for example the preboot configureren or HDD conf