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

Tags: BlackBerry Developers

Similar Questions

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

  • Persistent data and uninstall an app problem.

    Hello

    I'm checking the storage of persistent data with a very silly application, but maybe I'm do sth wrong as that it does not work as I supposed it should.

    My application only checks if there is some content in the store persistent and if not, it creates. I want to check that when the application is uninstalled, these persistent info will be deleted, but as I just test, it is not.

    This is my code:

     public TestP(){
            String info = "nothing";
            synchronized(store) {
                String currentinfo = (String)store.getContents();
                if(currentinfo == null) {
                    //we create it
                    String contents = "something";
                    store.setContents(contents);
                    store.commit();
                } else {
                    //we retrieve it
                    info = currentinfo;
                }
            }
    
            MainScreen ms = new MainScreen();
            ms.add(new LabelField("Testing Persistance..."));
            ms.add(new LabelField(info));
            ms.add(new LabelField("That's all..."));
    
            pushScreen(ms);
        }
    

    And that's how I create the store

    'com.app.test.TestP' at long---> 0xcdbcc77c2e7ecf8cL
    Bank private static PersistentObject = PersistentStore.getPersistentObject (0xcdbcc77c2e7ecf8cL);

    The first time I run my application, the display will return to "nothing" and the text next time 'something '. It's ok, but when I uninstall my application, the first time also shows 'something', which according to me, that he should not be allowed.

    I do something wrong?

    How persistent store information can be removed on an uninstall of the application?

    Concerning

    Your persistent data are of type String, which is a common object of the rim.  It is not necessary for the BB to delete your data - another application can use it.

    However, if you used one of your own classes - even if it comes extends the string and does nothing else - then it will be deleted when your Application is removed, because with your driveway application, there's nothing on the device which includes that Object.

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

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

  • I need a few persistent data store help of Pentecost

    Hi, I have a problem, try to store persistent data, I m using Eclipse 3.4.2 and BlackBerry plugin, as I check my work with the correct laboratory and my code hasn´t issues only a warning I see on the laboratory code it s normal, but when I try to run the Simulator I get this:

    "Eception exception: lack of measurement of the resource.

    and this is the code

    package com.rim.someguy;
    
    //Import section
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.container.*;
    import net.rim.device.api.system.*;
    import net.rim.device.api.util.*;
    import net.rim.device.api.i18n.ResourceBundle;
    import java.util.*;
    
    public class measure extends UiApplication implements measureResource{
    
        //Variables for user interface fields
        private EditField numMeasureDev;
        private AutoTextEditField observation;
        private EditField lecture;
        private ObjectChoiceField choice;
        private EditField date;
    
        //Persistent data
        private static Vector data;
        private static PersistentObject store;
    
        //Resource bundle variable
        private static ResourceBundle _res;
    
        //MAIN
    
        public static void main(String[] args){
            measure app = new measure();
            app.enterEventDispatcher();
        }
    
        //Save Menu
        private MenuItem saveItem = new MenuItem(_res, SAVE, 110, 10){
            public void run(){
                StoreInfo nfo = new StoreInfo();
                nfo.setElement(StoreInfo.NUM, numMeasureDev.getText());
                nfo.setElement(StoreInfo.LEC, lecture.getText());
                nfo.setElement(StoreInfo.DAT, date.getText());
                nfo.setElement(StoreInfo.SEL, _res.getString(choice.getIndex()));
                nfo.setElement(StoreInfo.OB, observation.getText());
                data.addElement(nfo);
    
                //Storing data
                synchronized(store){
                    store.setContents(data);
                    store.commit();
                }
                Dialog.inform(_res.getString(APP_SUCCESS));
                numMeasureDev.setText(null);
                lecture.setText(null);
                date.setText(null);
                choice.setLabel(null);
                observation.setText(null);
            }
        };
    
        //Get Menu
        private MenuItem getItem = new MenuItem(_res, GET, 110, 10){
    
            protected int index;
    
            public void run(){
                synchronized(store){
                    data = (Vector) store.getContents();
                    LabelField label = new LabelField();
                    label.setText("Selecciona el dato a mostrar: ");
                    BasicEditField bef = new BasicEditField();
                    index = Integer.parseInt(bef.getText());
                    if (!data.isEmpty()){
                        StoreInfo nfo = (StoreInfo) data.elementAt(index);
                        numMeasureDev.setText(nfo.getElement(StoreInfo.NUM));
                        lecture.setText(nfo.getElement(StoreInfo.LEC));
                        date.setText(nfo.getElement(StoreInfo.DAT));
                        choice.getIndex();
                        observation.setText(nfo.getElement(StoreInfo.OB));
                    }
                }
            }
        };
    
        //Persistent Object
        static{
            //Resource Bundle
            _res = ResourceBundle.getBundle("measure");
    
            //Get the reference to PersistentObject and set value to Vector if is empty
            store = PersistentStore.getPersistentObject(0xdec6a67096f833cL);
            //key is a hash
            synchronized(store){
                if (store.getContents() == null){
                    store.setContents(new Vector());
                    store.commit();
                }
            }
        }
    
        //Class created for a persistent object StoreInfo
        private final static class StoreInfo implements Persistable{
    
            //Data for elements
            private Vector elements;
    
            //Fields
            public static final int NUM = 0;
            public static final int LEC = 1;
            public static final int SEL = 2;
            public static final int OB = 3;
            public static final int DAT = 4; 
    
            //in StoreInfo, add a new empty Vector with capacity of 4 elements and persist
            public StoreInfo(){
                elements = new Vector(5);
                for(int i = 0; i < elements.capacity(); ++i){
                    elements.addElement(new String(""));
                }
            }
    
            //Retrieve Vector element
            public String getElement(int id){
                return (String) elements.elementAt(id);
            }
    
            //Set Vector Element
            public void setElement(int id, String value){
                elements.setElementAt(value, id);
            }
        }
    
        //Measure constructor declaration
        public measure(){
    
            //Create a main screen
            MainScreen mainS = new MainScreen();
            mainS.setTitle(_res.getString(APPLICATION_TITLE));
            numMeasureDev = new EditField(_res.getString(TEXT1),"",
                    Integer.MAX_VALUE, EditField.FILTER_NUMERIC);
            lecture = new AutoTextEditField(_res.getString(TEXT5),"",
                    Integer.MAX_VALUE, EditField.FILTER_NUMERIC);
            date = new EditField(_res.getString(TEXT6),"");
            choice = new ObjectChoiceField(_res.getString(TEXT2),_res.getStringArray(OPTION));
            observation = new AutoTextEditField(_res.getString(TEXT3),"");
    
            //Adding elements to Screen
            mainS.add(numMeasureDev);
            mainS.add(lecture);
            mainS.add(date);
            mainS.add(choice);
            mainS.add(observation);
    
            //Adding menuItems to menu
            mainS.addMenuItem(saveItem);
            mainS.addMenuItem(getItem);
    
            //Push all elements to screen
            pushScreen(mainS);
        }
    }
    

    If anyone knows what I m hurt you showme how please!

    Two thoughts:

    1. If you have changed somehow the object type that you want to keep, you must remove the Simulator files before running again.
    2. How about you provide a clue as to where the class cast exception that happens? You are more likely to help in this way.
  • 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.

  • Binds a shared variable to a NOR-PSP data object does not work

    Hello

    I want to share data between a RT-target and one or several hosts (LV 8.6.1). Shared network variables are deployed to the target RT.  According to NOR to access shared another project or host variables must be done by defining a variable shared on the host computer and the aliasing they NEITHER-PSP data object on the target.

    I did and the shared host variable was an error (0x8BBB0011) during execution.

    Next I have an alias to a shared variable, deployed on the host to another project. It worked.

    Another thing I tried was to bind the variable of the RT-target to a display element:

    This works! And as you can see that the path of the NOR-PSP data object is exactly the same thing! So, what is the difference between linking a data object to a shared variable and a display element?

    Is there a bug in the EVS, or am I missing something here?

    Home project:

    The VI editor

    Hope someone has an answer.

    Concerning

    Matthias Quade

    Dear Mr. Quade,

    Thanks for posting on the Forum of National Instruments. There is a known issue with the path of the linked with LabVIEW 8.6.1 variable

    Please download the patch for LabVIEW 8.6.1, it should solve your problem:

    http://Joule.NI.com/nidu/CDs/view/p/ID/1255/lang/de

    Best regards from Munich

  • ClassCastException JVM error 104 on A14 storing downloaded persisted data example

    Hello world

    I've been running examples of demonstration programs using Eclipse. I'm ok with A10 write your first application and UI A11, but on trying to run A13 storing persistent data, I get FMV 104 Eception ClassCastException error.

    The code is exaclty as in the downloaded example, so I can't imagine what the problem is.

    Someone else had a similar problem please.

    Thanks a lot for your help

    Roy

    I have actually used this particular article, but I didn't need to compile. Once I realized the syntax is relatively simple, in my humble opinion.

    Good luck with the rest of your development,

    ~ Dom

  • How to store/retrieve 'Date' using persistent data?

    Hello everyone - this is my first post on the BlackBerry Support Forums. I'm trying to provide a lot of relevant information as possible, but if I miss anytihng or I did not understand by asking what I want, please let me know.

    Background:

    I use Eclipse IDE ver 3.5.0 and BlackBerry Java plug-in for Eclipse 1.1. I build my application for BlackBerry JRE 5.0.0.

    Question:

    I want to save a "Date" field for persistent data so that I can recover and display in the format of Date once again (no chain). Here's a more detailed explanation.

    My application has three fields on the main screen. They are

    'Name' - AutoTextEditField

    "Gender" - ObjectChoiceField

    "Date of birth" - DateField

    Using persistent data to store the data entered into these fields, as described in the BlackBerry tutorials (http://na.blackberry.com/developers/resources/A13_Storing_Persistent_Data_V2.pdf), I am able to save and retrieve all of these areas, but only in 'Chain' format.

    Unfortunately, this won't work for me for the following reason.

    I create the Date of birth as follows

    "dateOfBirthField = new DateField (" BirthDate: ", System.currentTimeMillis (), DateField.DATE" ");"

    This creates an interface evolved for Date of birth, where the user can select and edit fields month, Date and year separately. When the user saves the information entered and wants to retirve it again, I want to display the date recorded in the same format so that the user can change again in exactly the same way as described above. But if I save it as a string, I can't fill in the field "Date" with the "chain" recovered. That is, I can't do something like

    dateOfBirthField.setDate (info.getElement (StoreInfo.DOB));

    Where "info.getElement (StoreInfo.DOB)" is similar to what is described in the tutorial.

    I searched the web for a possible solution, but never found any. All I found to date stored as a string and recovered just to see what was saved, but not for the changes resulting.

    Someone please let me know if what I am asking is possible. If Yes, can you please suggest a way to do it?

    Thanks in advance.

    Or it can store any object extra Long, no need to create garbage in chains.

    Long I = new Long (1234556);

    long x = i.longValue)

  • Can be persistent data that is stored on PC edition

    Working on the same project and managed to save persistent data. It's fine for the restoration of the database, but I hope to be able to change the data and possibly add more data, then restore it on the device.

    Q1: I use the right method to do this?

    I followed the example in chapert 9 of the development environment Java BlackBerry version 4.1.0.

    Q2: I came across a problem.backing to the top my persistent data is only the Setup program for one of my stores. How can I configure my backup so that the two stores are backed up?

    Thank you.

    [can someone who understands why we need of Html messages and text not just explain to me why the 'tab' and BACKSPACE navigates]

    you to another page, and not only in the icongraphic world?? ]

    At a minimum, you must understand the hierararchies and is that a cast - you can try to search on the term of classcastexception

    confined to sun.com as a good starting point (they have java tutorials large and your question relates to java).

    Anyway, after navigation back here and hoping the r eidot returns after each keystroke, let me see what is on my Clipboard.

    If you take your unknown x and do something like that.

    String nm = x.getClass () .getName ();

    the name should give you an idea what you have - in all the liklihood, it isn't what you expect, but in all cases, you should

    be able to determine if (x instanceof test) is true or false.

    Situations where you cannot know a priori what you (isn't usually a good thing), you can call different trees to help

    castexceptions (although it would probably be better of instanceof tests or same string on the result of above, nm)

    almost never, you want to implement logic nothing exceptional in exception handlers, but it can be easy sometimes).

    try {mi.add (new PhluBroMenuItem (app, (String) x, idx)) ;}}
    catch (ClassCastException e)
    {try {mi.add ((MenuItem) x) ;} catch (ClassCastException f)}}
    {mi.add (new PhluBroMenuItem (app, x.toString (), idx)) ;}}
    catch SomeDumException f)
    {mi.add (new PhluBroMenuItem (app, "without string result", idx)) ;}}

  • Can I evaluate and fill out a form with data from a custom data object?

    I'm not a developer, but I'm trying to find as much information for my web team so they can implement this for me.  We use the E10.

    I have some information for the contacts stored in a data object custom I want to use for pre-population information access door and in another form.  For example:

    1. User enters his email address into a form and hands
    2. A search and contact and custom data object (CDO)
      1. If the contact has a CDO with the required information, he fills the following form with the information
      2. If the contact does not have the required ORDER, it displays information and a link to the place where to go next

    Is it possible, and where should I direct my developers learn more about treatments?

    Richard

    Hi Richard,

    You can certainly do so using data for the Eloqua Web search (Setup > data Web Look Ups). A database search allows you to request data stored in Eloqua, bring up the page and with a few JS, we determine if they will go on track 1 or 2 you described above.

    Is that an advanced feature requires knowledge of HTML and JS. Here is a good article on data search that should help:

    Using the Eloqua Cookie to customize your Web site

    If you have any specific questions, our support team is very familiar with this feature and can help to solve problems or answer specific questions.

    -Andrew.

  • Process of reading/definition of component Java Spring or XSLT data objects

    I have a BPMN process that refers to a service component of spring.
    The spring has a Java class and within this category, I would like to be able to reference the data of the BPMN process objects.
    Ideally, I would like to simply read and write to these objects within the Java class.
    However, if this is not possible, I have not I can define the input parameter for the Java class and have it return an object.
    If I go this way, how spend or return an object of one type other than your standard types (string, int, boolean)?

    For example, I have a data object is a type that I created, based on a schema.
    How do I refer to one in a Java class?

    Hope that makes sense.
    Thank you
    Mike

    Mike,
    Steps 1 to 3 are correct. You should not change the WSDL file however. You have 2 options:

    1. create the POJO with your code of spring which have the same or similar structure to the schema you want to use. Add them as arguments and the return type of your operation. Then you can re-create the exposed service and it will regenerate your WSDL with the new definitions of type of these objects.
    2. you could generate your existing schemas JAXB java objects and use them as the argumengs and types back. We had problems in the past with this so it may not work for you, depending on your version.

    Thank you
    Adam DesJardin

  • Problem importing specific data from .csv file

    Hello!

    I use JDev 11.1.3.0 with JSF ui and I followed the excellent example on the importation of values separated by commas of a file .csv, M. Bors, but I have a specific problem...

    (1) when I try to import a value date (format dd/mm/yyyy) to a date field in my table of the adf, the date will not be accepted and it is not shown (I use Row.setAttribute ('field', text) for this purpose). I guess I have to enter in a specific format, but do not know how!
    (2) the same with double values. I tried showing 1.50 and it's on the table of the adf 0.02. Tried of 1.50 (with a different text separator) and he throws me an error and doesn't show anything on the table (again I use Row.setAttribute ('field', text) for that one too)...

    Any help would be appreciated!
    Thank you

    Published by: Nikolas Saridakis on 6 Νοε 2010 11:10 πμ

    I don't know, but it the seam that you set the type inappropriate at the table of the adf. I guess you read the CSV as string data. When you use

    row.setAttribute("filed_name", value);
    

    You must pass an object of the appropriate type of the attribute defined in the table. Therefore, convert the string containing the date to a Date object before asking in the previous row. Even with the double, you must convert the string "1.50' to a dual purpose."

    Timo

  • Persistent data in the copy/paste

    I have what I think it's a very simple problem I had a bit of difficulty to solve. I have a few persistent data added to kFrameListBoss that is not survive a copy and paste. Paste a picture containing my in a new document entitled results in the new framework with default values. I looked at the example of BasicPersistInterface and read by all relevant parts of the documentation for the SDK, I could find, but I don't see anything that indicates a special action that must be taken to ensure that data are copy/paste correctly.

    What might be missing?

    I doubt that kFrameListBoss.

    You can add persistent data on kDrawablePageItemBoss?

    I think that kFrameListBoss is recreated by the dough.

Maybe you are looking for