Persistent data backup

Hello

I'm developing an application in which I saved in the persistent store persistent collections.  I'm developing a backup strategy for the application.  I would like for my users to save data to their desktops and restore it if necessary.

As far as I could research, I found an option only: to register collections to sync with the Desktop Manager.

What is the best way to achieve this? If so, are there examples? One that I found in the BlackBerry Application Developer Guide Volume 2: advanced topics shows a lot of code, but it explains the process very briefly and because my request is configured very differently (each collection is in a separate class) as their example, I couldn't really use the code. They have mentioned that it can be done if the collections can be in different classes, but there is no example of how to do it.

In addition, there are alternative methods?

Any help is greatly appreciated.

Thank you

Daniel

I recommend having a look at the otabackuprestoredemo provided with the BlackBerry JDE.  It shows how an application can back up and restore data stored in the persistent store.

Tags: BlackBerry Developers

Similar Questions

  • 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)) ;}}

  • Restore the iTunes app data backup and backup to iCloud

    My iPhone 6 has been stolen. I got iCloud backup enabled, and the last backup was 2 days.

    I do a full backup encrypted via iTunes it also sometimes manually, the last time was 1 month ago.

    I bought a 6 new iPhone as a replacement. When I tried to restore from your backup, everything (photos, applications, settings) seems to be restored very well, but most of my applications (not all) were missing from their app data.

    More importantly, Google Authenticator, which had all my keys to two factors and in hindsight, an app that follows the historic activity and has experienced a year of daily data stored on the device value authentication.

    I don't understand why it affected only a few applications, but not all. Most applications requiring a login account is no longer connected, makes me think that their data was not were properly restored either. I found one or two applications that had some settings restored properly, but most of my apps seem to be returned to a State of the new facility.

    I tried to re-do the restoration of iCloud again and got the same results.

    I'll try the iTunes backup restore then, but even if it works I would miss even 1 month of a data value. Is it possible to recover this data? I guess that that's actually in the iCloud backup 2 - old days, but for some reason any, that he is unable to restore.

    Is it possible to combine the full restoration of iTunes and then update with the most recent data backup to iCloud app?

    Update: when I tried to restore the iTunes backup I received this error a few minutes:

    Is it because the original phone was an iPhone 6 and the new phone is a 6s? Is it possible to access my backup?

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

  • Force the persistent data that is not retained on App upgrade

    Hello

    I'm developing a new version of an existing application. The earlier version of the data stored in the persistent store of the device. When a user installs the new version of the application, they get a prompt saying something like "the persistent data is stored on the device. You want to keep these data? ».

    If the user answers Yes, the application will continue to use the old data which has been made persistent by the initial version of the application. This isn't what I need to happen.

    If the user answers no, the app will wipe the old dat and rebuild the store persistent with my current data. It is the course of action I want to request each time.

    Since there is no way to guarantee that each user will select 'NO' to this prompt, is it possible to configure the new version so that the data is not retained automatically?

    What other options are there for dealing with this situation?

    Thank you

    The f

    If the application can access the old data, why not just remove them when the application runs? In order to distinguish, again, you can design new data to contain a signature value that is not present in the old data. (For example, you can set your local record store to have record 1 always contain version store data, in a format that is not likely to be present in earlier formats.)

    An upgrade does not (usually) follow the same procedure with regard to the persistent data as a sequence of uninstall/install. However, there are occasional messages here on updates apparently lose persisted data that was supposed to be preserved. I did not understand everything exactly what are the causes which, but it has not considered the norm.

    P.S. If you use RecordStore instead of Persistable, custom classes are not relevant. The record store is deleted when all the MIDlets in the MIDlet suite, who created the store folder is uninstalled.

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

  • 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.
  • Persistent data store must signed Key?

    I don't know if I changed another somenting, but since I've implemented persisted data, I can not run the application on my real device...

    I get: error at startup appname: Module "appname-2' attempst to access a secure API."

    I don't want to buy a key signed because I don't need...

    That's what I use:

    Net.rim.device.api.system import. *;

    ... code...

    long KEY = "APPNAME.COM".hashCode ();

    persist is PersistentStore.getPersistentObject (KEY);.

    SerialRegistrado = (String) persist.getContents ();

    If (SerialRegistrado == null) {}

    application.popScreen (this);

    new Valida (application, next);

    SerialRegistrado = new String();

    SerialRegistrado = "Epaloco";

    persist.setContents (SerialRegistrado);

    Persist.Commit ();

    }

    If it does not need a signature key, can someonel help me how to identify code that needs a key?

    I checked http://na.blackberry.com/eng/developers/javaappdev/codekeys.jsp but cannot find anything

    Help, please...

    Of PersistentStore API:
    Category: Signed: This element is accessible only by the signed applications. If you intend to use this item, please visit http://www.blackberry.com/go/codesigning for a set of keys for code signing. Code signing is required for applications running on BlackBerry smartphones. development on the BlackBerry Smartphone simulators can occur without code signing.
    Since: JDE 3.6.0

  • Essbase data backup script

    So I a. The MSH, with the following basic information file, where if I schedule this task, I will get a backup of data for the date file this script has been planned and in the next race, the same name of file to the backup.

    I would like to be able to get this script to save the backup based on the date it has been executed and produce a new backup file based on the date of each subsequent executions.

    Someone at - it something like that they would like to share with us?

    echo "- INITIALIZE ROUTINE -";

    echo "this script can be run every night to perform backups of data export of Essbase;

    echo "Begin recording in the backup log file ';

    spool to DataBackup_AllApps_Log.log;

    ECHO "";

    echo "- PERFORM REQUEST LOGIN -";

    echo "log on to the server by using the: userid, password and server name"; "

    login password admin on hyperionserver;

    ECHO "";

    echo '- LOG OUT ACTIVE server SESSIONS -';

    echo "commands of disconnection from the current system of execution... » ;

    ALTER system disconnect session force them all;

    ALTER database Demo.Basic unlock all objects;

    Change the system asks to kill all them.

    echo 'Objects unlock complete on server';

    ECHO "";

    echo '- EXPORT ESSBASE DATA BACKUP -';

    echo "Running export orders Database...". » ;

    export data from database demo.basic Level0 to data_file 'C:/Oracle/Administration/DataBackup/DataBackup_Demo_Basic_File.txt ';

    echo "Completed data backup export";

    ECHO "";

    echo "- TERMINATE ROUTINE -";

    spool off;

    "exit";

    Hello

    Before start using script Hari add below lines

    echo off

    @REM * SETTINGS *.

    @call D:\back\Backup.bat

    Set year = % date: ~ 10, 4%

    Set day = % date: ~ 7, 2%

    Set months = % date: ~ 4, 2%

    define a day = %% months %% % of the year

    hh = % time: ~ 0, 2%

    mm = % time: ~ 3, 2%

    the value of ss = % time: ~ 6, 2%

    the value t = % hh % mm % ss %

    essmsh %filepath%Backup.mxl % essuser % esspwd % esssvr %%%d % tm dt

    Rename 'D:\back\security.txt' 'D:\back\security%d%_%t%.txt '.

    Rename 'D:\back\alldata.txt' 'D:\back\alldata%d%_%t%.txt '.

    Backup.bat

    spool to 'D:/bck/EssbaseArchive.log ';

    Set timestamp

    connection $essuser $esspwd on $esssvr;

    poster session;

    change the system asks to kill all them.

    alter system disconnect session any force;

    export database $essApp. $essDB all data to the server data_file 'D:\back\alldata.txt ';

    security_file export of data_file 'D:\back\security.txt ';

    change the $essApp database. $essDB force archive in the folder "d:/bck/sample.arc".

    change the $essApp database. end of $essDB archives;

    spool off;

    disconnection;

    "exit";

    So that it will be not any replacement of the existing backup files, remember you will have to go for some activities of housekeeping that it could consume space.

    If _1, _2 files because although I mean more than 2 GB of data, then you may need to modify the script to rename all the files in the directory using a loop for.

    Thank you

    Amith

  • Essbase data backup and recovery

    Hello

    We have a process in place for the App backup folder... I saw a process where data recovery is made by just the files ind and pag... and the restructuring of the DB... it is a good practice for the data backup and recovery...

    Assuming that the pag and index files are in the same location that the db files then, stop the application, restore the files, start up, up to you if you want to restructure as if you have restored all the files, it will be in the same State when the backup was performed.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

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

  • Question about: Checker run contained 2 new persistent data failures in EM

    Hello

    I received this alert showing in the homepage of the MA:
    Checker run found 2 new persistent data failures
    When I click on the message, it opens a new page, but there are no details available for example, what files were involved or anything else.

    The question is: Is there a way to know where these 2 data failure? (where, I mean what files were involved).

    Thank you very much for your help,

    John.

    PS: I'm using Windows XP Pro SP2 and Oracle 11 g 2

    ALTER TABLESPACE OFFLINE NORMAL ' TEST'
    Completed: ALTER TABLESPACE 'TEST' CONNECTION NORMAL offline
    Mon Aug 23 00:02:28 2010
    Running the Checker found 2 new failures of persistent data

    Think you the message "Checker run found 2 news given persistent failures" refers to the 2 ' fatal NOR connect error 12170 "appearing above it?

    Yes.

  • Create, save data backup

    Hello

    This is probably a fairly common question, but I looked around and either did not answer or did not understand them. I honestly don't know who. So, without further ADO, here is my question.

    My iPhone becomes quite comprehensive, so I was thinking about the removal of some of the games I have on it to make room for the new. I have a few save data on the apps that I would still be there when the application is downloaded again later. Is there a way to do this?

    Thanks in advance.

    App data is stored in the backups of iOS - iTunes or iCloud.

    The backup of your iPhone, iPad and iPod touch - Apple Support

Maybe you are looking for