persistentStore key

Hi all

To apologize for such a newbie question. I read the tutorial "PersistentStorage" and everyhing is clear to me, except for one thing.

private static long key = 0xdec6a67096f833cL;

static {
    _objStore = PersistentStore.getPersistentObject(key);
    synchronized(_objStore){
        if (_objStore.getContents() == null ){
            _objStore.setContents(new Vector());
            _objStore.commit();
        }
    }
    _data = (Vector) _objStore.getContents();
}

Where to get/get key? Is is something that you need to generate in advance? If it is, how to generate? There is absolutely no info on this key on the tutorial... It's right here...

Choose a channel which is likely to be unique (for example, the name qualified full of the main class of your application). Type in a comment (to keep Eclipse to complain):

com.example.blackberry.MyApp

Then highlight the string, right-click and select "Convert String to Long" in the menu. Now, you get a key. You can write a second line of comments to the document where it comes from.

I forgot where I heard this, but it was the rim documents somewhere. I agree that it is not documented where you are likely to be read when you need it (like the API docs for PersistentStore).

Tags: BlackBerry Developers

Similar Questions

  • PersistentStore and KEY identifier

    Hello

    Sorry if this has been posted before, but using a search by keyword on this forum helped me...

    I want to know how to generate the hash key used as a 'unique identifier' when using a PersistentStore?

    I know this hash is generated by a string that identifies the path of the 'package', but I do not know how to generate a.

    Best regards

    Strato

    Hi BBDeveloper!

    Thanks, this is exactly what I want!

    Thank you very much!

    Best regards

    Strato

  • Quit an App World app with new keys

    Hello, I have an application on App World. I intend to change my signature keys (please don't ask why). I have two questions about this.

    When I download a new version of my app in App World with new signature keys.

    -Will the new application will replace the application in the device users. (The old version of Wil erased)

    -Persistentstore and store objects will remain from the previous version. (I can continue using the registered user data.)

    Thank you

    Onur

    You can change the keys having no impact on BlackBerry OS 7.1 and lower code signing.

    There are problems if you change the keys used to sign applications BlackBerry PlayBook and BlackBerry 10.

  • PersistentStore.getPersistentObject returns the null value?

    I use a random key to retrieve a shape of the object PersistentStore

    persist is PersistentStore.getPersistentObject (KEY);.

    Works fine on the Simulator (OS 5), when I take the code signed to the device (BB OS 5.0 Bold 8900)

    For some reason, it returns null, without exception. Thereafter any API I inoke on PersistentStore / persist returns null without exception persist even when the null value.

    I don't know if it's one thing to eclipse debugger, but even if the debugger shows that objects are null. Controls null applied in the code seems to fail, what does code see these objects as non-null. Pheww! How is it possible.

    In this code still shows up as null, then safetyTable and orderedkeys. However, the value null check in the failure code.

    At a later stage in the code, when I try to access orderedkeys are null again! Are struggling with this problem for two days, all the pointers would be very comfortable.

                        persist = PersistentStore.getPersistentObject( KEY );
                        persistOrderedKeys = PersistentStore.getPersistentObject(KEY_ORDERED_KEYS);
                        safetyTable = (Hashtable)persist.getContents();
                        orderedKeys = (Vector)persistOrderedKeys.getContents();
                        if (safetyTable == null)
                        {
                            safetyTable = new Hashtable();
    
                            persist.setContents(safetyTable);
                            persist.commit();
                        }
    
                        if (orderedKeys==null)
                        {
                            orderedKeys=new Vector();
    
                            if (safetyTable.size()>0)
                            {
                                Enumeration addressKeys = safetyTable.keys();
                                while(addressKeys.hasMoreElements())
                                {
                                    orderedKeys.addElement((String)addressKeys.nextElement());
                                }
                            }
                            persistOrderedKeys.setContents(orderedKeys);
                            persistOrderedKeys.commit();
    
                        }
    

    "I don't know if it's one thing to eclipse debugger.

    I had problems of this kind when I don't have a level of operating system for the device I am debugging on.

  • How to generate keys for persistent object?

    How these keys are generated?

    PersistentStore.getPersistentObject (0xa1a569278238dad2L);

    Create a string like:

    com.foo.myFoobar.store

    The highlight in the JDE Editor, right click, and select "convert long."

  • Help with CodeSigningKey and. KEY files

    I'm having a lot of trouble trying to encrypt login information I want to store in the PersistentStore.  I tried the rest of this article:

    http://supportforums.BlackBerry.com/T5/Java-development/protect-persistent-objects-from-access-by-UN...

    But the first thing he asks you to do is to get a. Since the BlackBerry 'Administration of private key' KEY file tool.  When I ran this tool it does not enter all the information, it shows me just what looks like a dialog box public key with an Email, buttons change password and exit.  Where is the. KEY file?  It is not in the location of the file:

    C:\Program search in Motion\BlackBerry password Code signature Authority\data base

    I see an 'ID' field with a letter from four ID key, but when I use it in my application I get a result CodeSigningKey.get draw (moduleHandle, "XXXX").

    My application has files .csi for the signing of the code to enable it to run on a real phone, which works, I can't generate a .key for use of persistence file.

    Any help would be greatly appreciated!

    -Kevin.

    I have it.  It required an uninstall / reinstall in order to work.  I don't know why, but before he had a data directory, but had nothing in it and do not put anything in it.  After reinstalling, it created the data directory and place the .key file and I could continue with the steps and sign my application with my private key.

    Thank you very much for the shot, I didn't if I need a server web or not and that he feared IT would not work with Win7 64 bit.

  • 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

  • What is the "KEY" to PersistantStore?

    I have a few apps I did today and saved data (objects) in the store persistent using the regular:

           _persist.setContents( objectname );
            _persist.commit();
    

    and to load using the following:

              Options opt = new Options();
    
                _persist = PersistentStore.getPersistentObject( PERSIST );
                opt = (Options)_persist.getContents();     
    
                if (opt == null)
                {
                    opt = new Options();
    
                    _persist.setContents( opt );
                    _persist.commit();
                }
    

    My question is:

    I use the button "next" (or whatever it's called)...

     private static PersistentObject _persist;
        private static final long PERSIST = 0x9dbb6535e730ff3dL;
    

    Now, when I have several app using the same 'KEY', the object saves because of course, they will be of different objects, so I've just been arbitrially by changing the 'key' to something new PERSIST, not really knowing what it means / fact.

    Actually, I guess that this could be a major problem since one day I will probably bump someone else out there is perhaps using this 'KEY' (memory location?) and then my app will not work on their phone correctly.

    My question is, how do I 'generate' this key so that there is no conflict of interest, or I use this PersistentStore wrong?

    In the JDE if you highlight a string and a right-click, there is an option to convert it to a long.  What most people do, is use a complete package more than name ID.  Like: "com.foo.bar.mykey1."

  • Speeches and a .key file cannot be opened

    I'm unable to open or work on Keynote documents. I get an error popup image that says: cannot open 'FILE.key' because it is not a valid document to Keynote. I'm assuming that the same problem will occur in numbers and pages so I have not used either of these programs in a very long time so I do not have a file to test on.

    I know that the file is indeed a valid Keynote document. I recently had to reinstall my package iWork 09 since the original software discs - I have them have not purchased through the App store or my iCloud account. I have a software key. I can't move my OS to Sierra right now because I have other software that I use for work and tech support as we said we cannot go immediately. My current OS is El Capitan 10.11.6, and I have a MacBook Pro 15 "retina.

    Any advice on obtaining Keynote works again until I can make the upgrade to Sierra?

    Thanks in advance.

    Sounds like you are trying use Keynote 09 to open a file created by Keynote 6.

    Keynote 09 cannot open files of version 6 because they are a different file format.

    If this is the case, buy and install Keynote 6 from the Mac App Store.

  • How to find the key

    Is there a quick way to find the key of a song or instrumental that has been imported to the logic?

    No, you need a little music for this. I guess you could find it difficult to play with a keyboard and hear/guess the agreements/key?

    Here would be my suggestion for a workaround - if it is an entire song, as you indicate in your question:

    -To get agreements on a Web site

    -See if you can find the original version of keys (that would be easy, right?)

    - Then play these chords along your song imported. If they sound not right, transpose your up and down by steps MIDI track until it sounds right. -> Get your agreements and the key.

    If your song doesn't have agreements to seek, find parts of the song where you lift clear of bass notes (not too much battery), EQ everything, taking Tuner in pop in the track and see if you can pick up the dominant notes. That should lead you to your key of song.

  • Boot Camp El Capitan Windows ISO USB key

    Install Windows 7 with a USB key that is already configured as a windows installation disc, Boot Camp did not acknowledge the presence of the USB and claimed installation media. I inserted the DVD and it started to install.

    Is it possible that the Thumb control procedure is no longer necessary or do I lucky/unlucky?

    If she doesn't have a drivers W7 Apple pre-start, it won't work.

  • IPhone 7 will accept multiple fingerprints using the key ID?

    IPhone 7 will accept multiple fingerprints using the key ID?  If so, how?

    My iPhone 5 allows you to set up several fingerprints via settings > Touch ID & password, I doubt that the iPhone 7 would have fewer features.

    (I asked for your message to be moved to the forum from iPhone to help, do not know why you decided to post on the forum to help iPad.)

  • Some keys stop working after the update of the Sierra (only for a specific profile)

    After update to Sierra my keyboard worked well for a while.  But at random, U I O P J K L keys stopped working.

    The bug only shows 1 profile. If I create another profile new profile keyboard works very well.

    Anyone know what that sometimes caused that and with the fix is?

    Hello ExcelsiorPath,

    After reviewing your post, it seems that several keys do not work on a single profile. This looks like an option that may have been changed.  I recommend you to read this article, it may be able to help solve the problem.

    If the other keys do not work

    You may have accidentally set an option that changes your keyboard works.

    • Choose the Apple menu > System Preferences, click Accessibility, and then click keyboard. Make sure that slow keys is turned off. If slow keys is enabled, you will need to keep a key longer than usually before it is recognized.

    • Choose the Apple menu > System Preferences, click Accessibility, and then click mouse and Trackpad. Make sure that the mouse keys is turned off. If the mouse keys is enabled, pressing the keys in the numeric keypad moves the pointer instead of entering the numbers.

    • Choose the Apple menu > System Preferences, click keyboard, and then click input methods. Select "Show the menu in the menu bar." Open the menu entry, then make sure that the correct keyboard layout is selected.

      To display the keyboard layout, click keyboard, and then choose "See the viewers for emoji keyboard symbols in the menu bar."

    macOS Sierra: If your keyboard does not work

    Thank you for using communities of Apple Support. Good day.

  • Special keyboard keys Bootcamp-lost after upgrade to Windows 10

    I have an iMac of 2014 that was running Windows 7 with Bootcamp.

    I have upgraded to Windows 10 (using the upgrade option if windows) and everything was fine.

    After a power cut I can no longer start Windows 10 so I repaired the installation.  W10 is working now, BUT the special keys on the apple keyboard (brightness, volume, etc.) no longer work.

    I tried to re - download the software and drivers support for Win10 through Bootcamp Assistant, but he asks me if I want to delete the installation of Windows 7 (SEVEN Yes).

    Any ideas would be welcome.

    Thank you

    Download the driver appropriate for your model package specific to install Windows 7 and previous versions on your Mac with Boot Camp - Apple support on a USB2 flash drive and run setup.exe from the Bootcamp folder when it is started in Windows.

  • SSH keys no longer work after macOS Sierra Update

    Hello, I have a problem to connect my servers with my previously stored private ssh key in file .ssh with terminal commands or third-party applications. I should mention that I activated the filevault during the upgrade process. I see that my passphases are stored in the keychain, but I need to enter my password every time I want to connect to servers.

    Hello Marshall,

    Try to create a new ssh key. I think Sierra includes updated logic crypto and he doesn't like really old keys.

Maybe you are looking for