×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    43

    How do you access a shared record store?

    How do you access a shared record store? One final openRecordStore() method provides
    the answer:
    public static RecordStore openRecordStore(String recordStoreName,
    String vendorName, String suiteName)
    throws RecordStoreException, RecordStoreNotFoundException

    So I copy the verdorName and suiteName of the other application from the application descriptor.
    They are MIDlet Suite Verdor and Test MIDlet Suite.
    But the program gives the syntax error.
    Why?

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: How do you access a shared record store?

    Quote Originally Posted by gracy View Post
    How do you access a shared record store? One final openRecordStore() method provides
    the answer:
    public static RecordStore openRecordStore(String recordStoreName,
    String vendorName, String suiteName)
    throws RecordStoreException, RecordStoreNotFoundException

    So I copy the verdorName and suiteName of the other application from the application descriptor.
    They are MIDlet Suite Verdor and Test MIDlet Suite.
    But the program gives the syntax error.
    Why?
    Sharing Record Stores in MIDP 2.0
    In MIDP 2.0, record stores also have an authorization mode. The default authorization mode is AUTHMODE_PRIVATE, which means that a record store is only accessible from MIDlets in the MIDlet suite that created the record store. This is exactly as described earlier.

    Record stores can be shared by changing their authorization mode to AUTHMODE_ANY, which means that any other MIDlet on the device can access the record store. Be careful with this! Don't put any secrets in an AUTHMODE_ANY record store. In addition, you can also decide if you want a shared record store to be writable or read-only.

    You can create a shared record store using a new openRecordStore() method in the RecordStore class:

    public static RecordStore openRecordStore(String recordStoreName,
    boolean createIfNecessary, byte authMode, boolean writable)
    throws RecordStoreException, RecordStoreFullException,
    RecordStoreNotFoundException

    The authMode and writable parameters are only used if the record store is created, which implies that the record store doesn't exist and createIfNecessary is true. You can change the authorization mode and writable flag of an open record store using the following method:

    public void setMode(byte authmode, boolean writable)
    throws RecordStoreException

    Note that only a MIDlet belonging to the suite that created the record store can change its authorization mode and writable flag.

    How do you access a shared record store? One final openRecordStore() method provides the answer:

    public static RecordStore openRecordStore(String recordStoreName,
    String vendorName, String suiteName)
    throws RecordStoreException, RecordStoreNotFoundException

    To access a shared record store, you need to know its name, the name of the MIDlet suite that created it, and the name of the MIDlet suite's vendor. These names should be the MIDlet-Name and MIDlet-Vendor attributes in the MIDlet suite JAR manifest or the application descriptor.

    Make sure the recordstore you are trying to share is created with AUTHMODE_ANY.
    Thanks,
    Ekta

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: How do you access a shared record store?

    syntax error may simply indicate that there is an error in your syntax. when does the error appears ?

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: How do you access a shared record store?

    It's worth mentioning, some devices (notably Motorola) allow shared access between MIDlet suites only to signed MIDlet suites. I don't think this normally applies to Nokia devices, though it might do for devices with operator-specific security. It's a technique to avoid if you need cross-device portability.

    Note that two MIDlets in the same suite (same JAR) can always access the same RecordStores, without needing to use the authorization mode parameter.

    Graham.

  5. #5
    Registered User
    Join Date
    Nov 2010
    Posts
    43

    Re: How do you access a shared record store?

    yes, yes
    It is syntax error. I forgot to add double code " " . hahaha
    thanks for the replies.

Similar Threads

  1. Appending another byte array to the same record in a record store
    By cryptyritu in forum Mobile Java General
    Replies: 2
    Last Post: 2011-01-13, 07:48
  2. Encrypting data to store in record store
    By matan_d in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2009-01-04, 01:21
  3. Can a Symbian App access a j2me App's record store?
    By dogsrus in forum Symbian C++
    Replies: 3
    Last Post: 2008-02-18, 13:40
  4. Record Store vs JDBC. How to store data?
    By 180ºrevolution in forum Mobile Java General
    Replies: 0
    Last Post: 2004-09-17, 15:24
  5. Shared record stores
    By cwfvanoordt in forum Mobile Java General
    Replies: 4
    Last Post: 2004-01-14, 11:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •