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.

Tags: BlackBerry Developers

Similar Questions

  • insertLabel() in the Application object for storing persistent data

    I thought to store persistent information in the object of the application itself:

    Not so interesting snippet:

    app.insertLabel ("pxComplexName", "test");

    Later / safe restart

    app.extractLabel ("pxComplexName", "test");

    I know how to get labels from IDML. Does anyone know where the label of the Application is saved?

    I thougt about using this as a counter using simple script in a trial version of a script. Any thougts on this subject?

    Kind regards

    Gregor

    Labels of the application are saved in the application preferences file. When a user clears preferences, all recorded data as labels is removed. This can be a good thing or a bad thing - depending on what you need...

    Substances

  • 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

  • syslog not configured for persistent storage

    I'm under ESXi 4.0.0 261974 on one server HP Blade BL35p. installed fine and everything works OK apart if I try to access the console of the host. I get the following message "* SySlog is not configured for persistent storage"

    I looked at the Syslog settings under software/advanced settings and all is the default value for the local and remote. The only thing listed is port 514, which I believe is default. I have 3 virtual machines running on the local disk and 2 computer virtual running on an iSCSI target. Anyone know how I can get in the console of the host?

    Take a look at this article: http://kb.vmware.com/kb/1016621

    Rick Blythe

    Social media specialist

    VMware Inc.

    http://Twitter.com/vmwarecares

  • 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.

  • I think it would be helpful if when you open the drop-down list for a 3D object keyframe controls have the same color as the 3D arrows in the project window.

    3D colors.jpgI think it would be helpful if when you open the drop-down list for a 3D object keyframe controls have the same color as the 3D arrows in the project window.

    You can suggest that here:

    Feature request/Bug Report Form

  • Anyone know how to get your money back?  My CC application does not start and I have tried the suggested workaround solutions listed above and they have not worked for me.  The amount of problems listed here in the forum, I have to ask the product is real

    Anyone know how to get your money back?  My CC application does not start and I have tried the suggested workaround solutions listed above and they have not worked for me.  I'm new to the CC Apps but use the versions installed for years.  The amount of questions listed here in this forum, I have to ask the product is really stable?

    Thank you.  I've deleted and reinstalled.  Seems to have solved the problem.

  • 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.

  • Question about persistent storage

    By reading the developer's guide, I read this

    The following native data types can also be stored persistently:

    • java.lang.Boolean
    • java.lang.Byte
    • java.lang.Character
    • java.lang.Integer
    • java.lang.Long
    • java.lang.Object

    ...

    Previously, I was looking for a way to store a BlackBerryContact object with persistence.  The answer was that basically it is possible to reimplmenting the class myself.  However, if objects can be stored, would it be possible to mount the BlackBerryContact as an object, store it and cast then back after recovery?  It seems a bit simple to work actually, but I thought I could ask for more.  Happy Obama day!

    It is not advisable to directly store instances of outer class.

    External means that these classes are not yours.

    For example - if you have created an instance of the com.mycompany.myapp.MyClass class and stored in the persistent store - then when you uninstall your application - these instances of class will be removed too the persistent store.

    But if you directly - save an instance of the class java.util.Vector, or BlackberryContact, they will remain in persistent memory, your application is uninstalled.

    It is not a good approach.

    Use Memento design pattern.

    Create a class which instance stores snapshot of information to start an instance of BlackberryContact and store it in persistent memory.

  • 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.

  • 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.

  • 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.

  • Help: The ESXi host has no persistent storage

    We have an ESXI 5.0 installed on our Dell server and we have some virtual machines running. suddenly, we had a mistake on Vsphere client.

    "EXSI host has no persistent storage.

    To run the virtual machine, create at least a data store for the maintenance of the machines virtual and other system files. »

    to resolve this problem, so we tried.

    On Vsphere client (connected to the ESXI)-> configuration-> storage-> rescan all... once the re-scanner has been done.

    We are able to see the file was mounted on the data store and it is lost in a minute. so it isn't permanently mounted to the data store to access the virtual machine.

    Once we do the re-scan once again, we saw that the file has been fitted to the data store and lost again.

    assemble and disassemble is to continue to switch.

    We need a solution to fix the problem, or in the worst case we need a way to recover the Esxi machine (VMS) data.

    Kindly share the reflections.

    It should be a disk error, it is local storage that tempt you and the virtual machine files are stored in the local disk

    don't forget to check the logs on the bit/ucs, regardless of the remote management tool, you use...

    Please check the log files and vobd.log vmkernel

Maybe you are looking for