Problem on persistent object.

Hi friends,

My Simulator take a long time to load a program I m using the jde4.5 version. If we run clear.bat then we can accelerate simulator but I store an object any on the persistent object. It is persistent any object data erase if I run clear.bat?... is there another way to save the persistent object and make our quick Simulator to load the program. M pls kindly help.

Kind regards

s.Kumaran.

Yes, clean.bat also erases store persistent Simulator (it stored in the *.dmp file).

But clean.bat takes a long time to run, because it removes all the additional files of the Simulator file system.

Tags: BlackBerry Developers

Similar Questions

  • Problem of persistent data object

    Dear Sir.

    Hello

    I am writing a module that implements the earpiece of the phone, simply

    and I would use persistent object to store information

    But I am facing the following problems:

    When I use the persistent objects, the Simulator to show that there is no instance of the application,

    as my program doesn't include any GUI,

    would my recognized program just as a Moudle and the persistent object should point the data store with an application?

    Thank you very much

    Please see the following for more information.

    http://supportforums.BlackBerry.com/T5/Java-development/persistent-data-and-uninstalling-an-app-issu...

    http://supportforums.BlackBerry.com/T5/testing-and-deployment/handle-stored-data-when-removing-an-AP...

    http://supportforums.BlackBerry.com/T5/Java-development/persistent-data-and-uninstalling-an-app-issu...

  • problem of persistent data store

    HI gentlemen

    I try to put in place the persistent object store, and I have a problem.

    1 problem: the key that I use for a few months, but sometimes when I getPersistentObject (key) it returns the null value, and in a certain type of bb phone, it always returns null, I what to ask is there a rule in key do?

    THX

    The usual practice is to use a facility to your tools to convert your package and name to an id, making it very unlikely that someone else will reuse the same ID.

    I have never see a null always return phone, even though I have stored a value in it.

  • Deleting persistent objects on uninstall

    If an application defines a class that implements Persistable, all persistent objects of this class are deleted when the application is uninstalled. It is logical and it is clear from the documentation. What is not clear, is what happens if your application is still a standard container (for example, a hash table) that in turn contains a Persistable custom class instances. The container class is deleted also? I guess it must be, otherwise, it would end up by plenty of broken references.

    Yes, it will also get deleted.

    If your problem has been solved to then please mark the thread as "Accepted Solution" and congratulations - your wish

  • Problems of persistent storage...

    Hello

    I was hesitant to post this because I thought it was a simple solution, so I tried to work around him. Basically, what happens is it saves, I can close my application and then reopen and it works. That is until I do a battery pull and everything disappears. Is this a problem with my source?

    updated source code

    public static ProjectVector get() {}

    Active = true;

    Vector ProjectVector = new ProjectVector();

    PersistentObject persist = PersistentStore.getPersistentObject (key);

    The object [] = (Object []) persist.getContents ();

    If (item! = null)

    vector = decode (object);

    Active = false;

    return vector;

    }

    {} public static Boolean save()

    If (active)

    Returns false;

    PersistentObject persist = PersistentStore.getPersistentObject (key);

    The object [] = encode (HomeScreen.projects);

    persist.setContents (object);

    persist.forceCommit ();

    Returns true;

    }

    Private Shared Object [] encode (Vector vector) {}

    The object [] = Object [vector.size (new)];

    for (int i = 0; i)< object.length;="">

    object [i] = ((Project) vector.elementAt (i)) .toObject ();

    Returns the object;

    }

    Private static ProjectVector decode (Object, object []) {}

    Vector ProjectVector = new ProjectVector();

    for (int i = 0; i)< object.length;="">

    vector.addElement (new object [i] ((Object[]) Project), true);

    return vector;

    }

    I got a vector that contains another vector with objects of string inside, but who do not also have. I then moved to multi dimensional object, but that is a failure. Does anyone have advice? Should I try the channels and divide them?

    I had experience where to stop persistent objects appeared updated for all applications to look at one, but updates are lost on a battery pull.  So I agree with the comment by BBDev which lacked the first variation of the code you have posted.

    I guess you've proven that encoding, followed by a decoding does not cause a problem, in other words, the data is not lost in this process.  I have to say it seems a bit weird how you convert a vector into an array of objects, why you not store just the ProjectVector?

    In any case, I would do the following:

    Split lines

    The object [] = (Object []) persist.getContents ();

    If (item! = null)

    in what follows:

    Object o = persist.getContents ();

    If (o! = null & o instanceof (Object [])) {}

    The object [] = (Object []) o;

    Now add a breakpoint to

    Object o = persist.getContents ();

    Check at this stage that the key is correct, then to let the getContents() proceed and check the returned object and watching the treatment whose object is in.

    Finally, a break point to:

    persist.setContents (object);

    At this point, check the key is correct, and this is what you expect it to be.  With these two points of rupture in place, through battery pull (i.e. to restart the Simulator) and make sure that the object you return to the get() method is what you expect.  This will determine if the problem is in the persistence or the logic of encode/decode.

    I hope this helps.

  • change the value of an object in the content of the persistent object

    Hello

    I'm triyin to make a customizable menu, saving the preferences of the user as a custom class in a hash table which is the content of my persistent object.

    the custom class "Favoritos" is like this:

    public class Favoritos implements Persistable {
          private Boolean[] misFavoritos = new Boolean[10];
    
          public Favoritos() {
            super();
        }
    
        public Boolean[] getMisFavoritos() {
            return misFavoritos;
        }
    
        public void setMisFavoritos(Boolean[] misFavoritos) {
            this.misFavoritos = misFavoritos;
        }
    }
    

    and the hash table custom:

    public class CustomHashtable extends Hashtable implements Persistable {
    
    }
    

    in my menu configuration screen, I show the options selected as Favorites, which are defined as true in Boolean Favoritos object table in the hashtable. I retrieve the values or set them all as false if they have not been registered before, like this:

    PersistentObject persistentObject = PersistentStore.getPersistentObject(KEY);
    if(persistentObject.getContents() != null){
        CustomHashtable persistentHashtable = (CustomHashtable) persistentObject.getContents();
        if(persistentHashtable.containsKey("misFavoritos")){
        misFavoritos = ((Favoritos) persistentHashtable.get("misFavoritos"));
        }
        else{
        misFavoritos = new Favoritos();
        Boolean[] f = {new Boolean(false), new Boolean(false), new Boolean(false), new Boolean(false), new Boolean(false),
                  new Boolean(false), new Boolean(false), new Boolean(false), new Boolean(false), new Boolean(false)};
        misFavoritos.setMisFavoritos(f);
        persistentHashtable.put("misFavoritos", misFavoritos);
        persistentObject.commit();
        }
    }
    

    So I give to the user the possibility to define as true certain values and Boolean table, I try to change them this way:

    misFavoritos.getMisFavoritos()[i] = new Boolean(true);
    persistentHashtable.put("misFavoritos", misFavoritos);
    persistentObject.commit();
    

    Changes are persisted as I navigate the application, I want to say, if I close the configuration screen and open another configuration screen, changes of this show, but I I close application it loosse changes made a show all the elements of the array as false. What I do wrong?

    RuntimeStore is the other location people will such things, but it is cleared to restart the device, not the app.

    If you want to have something that you have to restart the application, then keep your storage apps and turn it off when leaving.

  • Question about the persistent object

    Hello

    When I used to store data using persistent object, data also will be deleted after uninstalling the app.

    Is there any data keep possibility even if the app is uninstalled?

    Can anyone give me a suggestion on this?

    Thank you.

    Objects are deleted when no request refers to them.

    So, if you have implemented a custom persistable object, whis would explain the removal.

    Use "Vanilla" persistable objects in the store, such as Hashtable.

  • How to exclude the field of persistent object

    Hello

    Is it possible to substitute the PersistanceStore method to persist objects?

    I have a complex data structure I need to store. One of the internal classes contain no persistent field. When I'm storing the data I don't no need to store this field, but the compiler triggers error.

    ... Widget: error! : class... Persistable marked widget by interface:... Persistable is not persistent: _field field: class... Field does not implement net.rim.vm.Persistable

    Is the way to override the implementation of this class persitant and exclude the problematic areas?

    Thanks for the reply.

    I did something similar, I created a class of data for persistence and a class of execution with additional fields.

    It's not very practical, these classes are deep into a tree of complex data, but I guess that's how it should work with BlackBerry.

  • Doubt about the persistent object

    Hi friends,

    I've stored data object persistent after that some time, my Simulator has taken a lot of time to load the application so I run clear.bat do fast Simulator. But after I run clear.bat. The values of what I stored in the persistent object had disappeared. Someone at - he said, therefore, it is the persistent object data are parties to cause of the performer, the clear.bat or any other reason. pls clarify my doubt friends...

    Kind regards

    s.Kumaran.

    It is b'caz of clean.bat. Clean.bat will remove all applications and unnecessary files, etc...

  • Problem of scaling objects

    Recently I have problems scaling of objects in Illustrator.

    I created an 8 x 8 mm rectangle and tried to Center on a 10 × 10 mm in canvas. What gave me Illustrator was 7 761 × 8 114 mm rectangle, which would not focus (this is a bit off). Whenever I try 8 mm across the rectangle it now clings to the 7 761 × 8 114 mm.

    I turned on and off at each function snap to grid, I could find, nothing works.

    What I am doing wrong?

    I use Illustrator CC on a Mac with os x Mavericks.

    See you soon

    CORVIN

    CORVIN,

    I think that you are haunted by the ghost of align it on the pixel grid .

    You can select the entire document and in the Transform palette, uncheck align on the pixel grid and also uncheck align new objects to the pixel grid in the Options.

    Snap to grid of pixels is the default value for certain types of documents.

    You can avoid those, or change the default value.

  • A little problem with an object

    Hi guys...

    I discovered a problem with an object, but I Don t see where the problem may be...

    I have a 'bomb' added to the step only if the var bomb is greater than or equal to 1... and, of course, if you enjoy it, the var Gets a-... However, after a while, it seems once again

    Any ideas?

    Here is the code bound to it:

    var dynamite: Loader = new Loader();

    Dynamite.Load (new URLRequest ("dynamite.png"));

    Dynamite.x = 650;

    Dynamite.y = - 10;

    var bombsound:Sound = new Sound();

    var bombsoundChannel:SoundChannel = new SoundChannel();

    var bombreq:URLRequest = new URLRequest ("bombexplosion.mp3");

    bombsound. Load (bombreq);

    If (! level) {var level: int = 1 ;}}

    var lvlup:int = 200;

    var updlvl:int = (lvlup * level);

    If (!) (Count) {var count = 0 ;}

    If (! bomb) {var bomb: int = 1 ;}}

    dynamite.addEventListener (MouseEvent.CLICK, buttocks);

    function bum(e:MouseEvent):void {}

    If (sonido) bombsoundChannel = bombsound.play ();

    -bomb;

    If (bomb == 0) {}

    If (dynamite.parent) {dynamite.parent.removeChild (dynamite) ;}}

    kill every1

    }

    function level1(): void {}

    If (level == 1) {}

    addChild (nivel1pic);

    If (bomb > = 1) {addChild (dynamite) ;}

    }

    }

    function level3(): void {}

    If (level == 3) {}

    removerViejoNivel();

    addChild (nivel3pic);

    If (bomb > = 1) {addChild (dynamite) ;}

    }

    }

    function level5(): void {}

    If (level == 5) {}

    removerViejoNivel();

    addChild (nivel5pic);

    If (bomb > = 1) {addChild (dynamite) ;}

    }

    }

    function level7(): void {}

    If (level == 7) {}

    removerViejoNivel();

    addChild (nivel7pic);

    If (bomb > = 1) {addChild (dynamite) ;}

    }

    }

    function level9(): void {}

    If (level == 9) {}

    removerViejoNivel();

    addChild (nivel9pic);

    If (bomb > = 1) {addChild (dynamite) ;}

    }

    }

    function level12(): void {}

    If (level == 12) {}

    removerViejoNivel();

    addChild (nivel12pic);

    If (bomb > = 1) {addChild (dynamite) ;}

    }

    }

    function updateLevel(amount:int):void {}

    level += amount;

    Level1();

    Level3();

    Level5();

    level7();

    level9();

    level12();

    }

    Level1();

    Level3();

    Level5();

    level7();

    level9();

    level12();

    Thank you!

    Use the function trace to track when the bomb is added.  IF this happens in each of the functions level, then add traces to everyone to see where and when that happens.

  • problem when getting the value of the persistent object

    Hello

    I am trying to store the State of registration of the user in my App I have used persistent store. But I don't get the bak of the store database. I wrote the code below:

    package com.saiservices.util;
    
    import java.util.Enumeration;
    
    import com.saiservices.ui.Logger;
    
    import net.rim.device.api.system.PersistentObject;
    import net.rim.device.api.system.PersistentStore;
    import net.rim.device.api.util.Persistable;
    
    public class SaiPersistentStore implements Persistable{
    
        private SaiHashTable mElements = null;
        static SaiPersistentStore instance;
        private static final long KEY = xxxxxxxxxxxx;
        private PersistentObject persistentObject = null;
    
        /**
         * Gets the single instance of DataBase.
         *
         * @return single instance of DataBase
         */
        public static SaiPersistentStore getInstance() {
            try {
                if (instance == null) {
                    instance = new SaiPersistentStore();
                }
            } catch (Exception e) {
                instance = null;
            }
            return instance;
        }
    
        private SaiPersistentStore()
        {
             Logger.out("PersistentStoreInfo", "inside constructor  ");
            persistentObject = PersistentStore.getPersistentObject(KEY);
             synchronized (persistentObject)
               {
                   if (persistentObject.getContents() == null)
                   {
                       persistentObject.setContents(new SaiHashTable());
                       persistentObject.commit();
                   }
               }
    
             mElements = (SaiHashTable)persistentObject.getContents();
             if (mElements == null){
                 Logger.out("PersistentStoreInfo", "************"+(mElements == null));
                 mElements = new SaiHashTable();
             }
        }
    
        public String getElement(String key)
        {
            Logger.out("PersistentStoreInfo", "getElement :"+key);
            Logger.out("PersistentStoreInfo", "getElement value   :"+mElements.get(key));
    
            return (String) mElements.get(key);
        }
    
        public void setElement(String key, String value)
        {
            Logger.out("PersistentStoreInfo", "setElement11111 :"+key + "   "+value);
            mElements.put(key, value);
            persistentObject.setContents(mElements);
            Logger.out("PersistentStoreInfo", "setElement22222 :"+key+"   "+value);
            persistentObject.commit();
        }
    
        public Enumeration getAllKeys()
        {
            return mElements.keys();
        }
    
    }
    

    And here's the code for hash table:

    package com.saiservices.util;
    
    import java.util.Hashtable;
    
    import net.rim.device.api.util.Persistable;
    
    public class SaiHashTable extends Hashtable implements Persistable{
    
        public SaiHashTable(){
            super();
        }
        public SaiHashTable(int initialCepacity){
            super(initialCepacity);
        }
    
    }
    

    Now, I'll put the element as follows:

    SaiPersistentStore.getInstance (.setElement("Registration","on"));

    But when I try to get the item in a way theis, gettting null value:

    SaiPersistentStore.getInstance () .getElement ("Register")

    Where I am doing wrong here?

    The fixed. Key hash table was different. Change it and it works...

  • Problem with Persistable

    I'm struggling a bit with data binding. I get data in XML format. I record it in the objects for later use.  These objects are made to be Persistable, because I want to store them in a hash which in turn, is stored in a persistent storage table.

    The application consists of separate projects for the definitions of these objects (classes) are shared between projects via a source like many other classes. Basically, it's a substantive project with listeners and some modules of action and a GUI project with business logic. This division has worked very well so far.

    The problem, in that I ran seems to emanate from having classes that define the data bound and made "Persistable".

    These related classes that implements "Persistable" causes an error message at the start of the second project

    in the Simulator.

    Error starting MobismaLogHandler class ' bbcommon. BBConstants' multiply defined

    Or is it another problem?

    "I understand that if a class which will be shared between 2 projects and implement"Persistable"then it must be in a library?"

    Pretty much.  To be 100% accurate, there may be a "definition" of a persistent class on the BlackBerry.  The best way to do this is to have classes as defined in a library and applications Persisted that share this library.

    "I used a library to share code between projects in the previous version of the app, but changed to source bound because it seems more simple."

    I think it's easier too, and she records the issues with packaging too since you know each "application" is completed. But this question is the result.

    "Your suggestion to change package name defeats the idea of having a shared common source wouldn't be?"

    Yes - because each "application" wouldn't be able to read the data stored by the other application.

    Now, I'm not sure that I have enough information to make a recommendation with 100% confidence, but I think you have two options:

    (a) create a library and import this library on the way to build projects that use it.  Then you can ship COD for each project and for the library.

    (b) all merge into a single project.

    There is a perhaps less alternative pleasant to the taste, and is to make all objects Persistable standard rim objects.  For example, you could store all your objects as strings in XML format and convert it into objects of analysis in the context of the recovery of the persistent store.  If your application program always gets an object, but the data that are persisted are the XML string.  But, apart from the fact that it's the conversion of objects to and from standard RIM Java classes, it also means as Persisted data will not be deleted from the unit when your application is removed.

    Hope it makes sense.

  • Persistent objects

    I know there is a problem with the definition of an object persistent in a library if two or more applications will use.

    But he is sure to have an object in a library that other applications it will be extended to an object persistent more complex?

    Which always causes an error with the persistent store?

    Sorry, I have contributed to some discussions and I do not remember that you speak...

    It was probably two applications, eager to share an object.  And the point that if they share an object, they must also share the full qualified class, which means that have to share a library containing this class.

    In any case two different GUIDS should mean that you have no problem. However, the library should be deleted, both will go.

  • Several persistent object

    Hi guys,.

    I am a new blackberry applications developer.  I am working on an app I need to store

    First of all:

    username (String)

    password (String)

    user (String) token

    Then I need to store travel information based on the user's token. Travel information contains a lot of vectors

    such as:

    Names of travel (Vector)

    Locator (vectors) travel

    ....

    I am able to stor channels without any problem in store it and retrieve it without any problem. I have problems storing vectors. This is my persistent class:

    class StoreUserInfo implements Persistable
    {
    private vector _elements;
    public static final int UserEmail = 0;
    public static final int UserPass = 1;
    public static final int UserToken = 2;
     
        Private vector _Trip_Locators; is it good?

    public StoreUserInfo()
    {
    _elements = new Vector (3);
    for (int i = 0; i)< _elements.capacity();="">
    {
    _elements. AddElement (new String(""));
    }
            
             _Trip_Locators = new Vector();  ////
    }
        
    public String getElement (int id)
    {
    Return (String) _elements.elementAt (id);
    }
        
    ' Public Sub setElement (int id, String value)
    {
    _elements.setElementAt (value, id);
    }
        
        public Vector getTripLocator()
    {
    Vector temp = new Vector();
    for (int j = 0; j)< _trip_locators.capacity();="">
    {
    temp.addElement (_Trip_Locators.elementAt (j));
    }
    Return (Vector) temp;
    }
        
        
    public void setTripLocator (String addValue)
    {
    _Trip_Locators.addElement (AddValue);
    }

       
     
    }

    Here's how to store information:


    synchronized (storeUser)
    {
    If (storeUser.getContents () is nothing)
    {
    storeUser.setContents (new Vector());
    storeUser.commit ();
    }
               
    UserInfoData = new Vector();
    UserInfoData = storeUser.getContents ((vector));
                        
    StoreUserInfo info = new StoreUserInfo();
    info.setElement (StoreUserInfo.UserEmail, UName);
    info.setElement (StoreUserInfo.UserPass, PWord);
    info.setElement (StoreUserInfo.UserToken, UserReceivedToken);
                        
    UserInfoData.addElement (info);
    storeUser.setContents (UserInfoData);
    storeUser.commit ();

    }

    and here's how to get the information stored:

    Synchronized (storeUserSaved)
    {
    If (storeUserSaved.getContents () is nothing)
    {
    storeUserSaved.setContents (new Vector());
    storeUserSaved.commit ();
    }
             
    SavedData = new Vector();
    SavedData = storeUserSaved.getContents ((vector));
             
             
    If (!.) SavedData.isEmpty ())
    {
    Info StoreUserInfo = (StoreUserInfo) SavedData.lastElement ();
    Political = info.getElement (StoreUserInfo.UserEmail);
    pass = info.getElement (StoreUserInfo.UserPass);
    sentUserToken = info.getElement (StoreUserInfo.UserToken);

    These work very well. However, I want to know how to store several objects (Vector) as unique user name.

    Could someone help me with this? I browsed the forum and I found similar posts, but still I can not solve this problem.

    Thanks in advance guys.

    Shan

    You can store a vector in the store persistent as long as all classes stored in the vector to implement the persistable interface.

    Can you elaborate on the problem that you are experiencing?  Is an error or an exception thrown?  If so, what is it?

Maybe you are looking for

  • Firefox won't let pages redirect when they need to. How can I stop this?

    When on Web sites, I have always used I have to "allow" for moving from one area to another. I didn't do it before. At the top, it says 'Firefox prevented this redirect page' or 'reload page' and then when I hit allow that it still does not a lot of

  • Is it possible to change the name of data acquisition device?

    Hi all Is it possible to change the name of device of data acquisition in a pragmatic way? I wish I had at the beginning, when I start the data acquisition control a name that my .net program assigns to the DAQ card. Is this possible? Thank you Virgi

  • Help drivers

    Hello I need help for some drivers I can't find and I want to know exactly what are the importance that they. I have a HP Pavilion G6-2305sq and I'm running a Windows 7 64 bit because I have to, not because I want to. Bluetooth controller; Ethernet c

  • Received a call from someone claiming to be from Microsoft - error in MS Windows event viewer and warnings

    I just got a phone call from someone claiming to be from Microsoft.  He directed me to go to MS Windows event viewer and County errors and warnings in the Applications and the system section.  Then he asked me to let them access my computer and fix a

  • Error code 31 MS ISATAP Adapter

    Not sure what happened, but I get this message error than MS ISATAP AdapterDevice is not working properly. Windows cannot load the drive of the device so require.ROOT / * ISATAP/0000 I went to MS and charged the driver, then he said I'm current and e