×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    May 2009
    Posts
    95

    Set nfc push registry dynamically...

    Hi,

    As some of you might have seen in my previous posts, i'm working on dynamic applications which loads apis according to the apis available on the phone.

    One of my last small problems is to dynamically add a push registry for nfc. The thing is that if i set it staticly, then the application won't work on phone which doesn't have nfc, so basically i need to set the nfc push registry if the phone has nfc available.

    The thing is that i'm not sure how will it work since we normally have code in the jad file and i don't think that the jad file can me modified during runtime and "save the changes"

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Beside of compatibility concerns (JSR not present, JSR needs signing, bugs) static registration cannot be turned off. You have to (and should always) register dynamically via the PushRegistry class rather than using the JAD. The first time your MIDlet is started, you register your connection which the phone stores virtually.

    More details about the NFC syntax can be found in the PDF specification of JSR-257 and examples can be found in the wiki or discussion sections which deal with NFC.
    Code:
    int format = NDEFRecordType.EXTERNAL_RTD;
    String name = "urn:nfc:ext:example.com:YourExample";
    NDEFRecordType type = new NDEFRecordType(format, name);
    String connection = type.toString(); // ndef:external_rtd?name=urn:nfc:ext:example.com:YourExample
    String midlet = getClass().getName();
    String filter = "*";
    PushRegistry.registerConnection(connection, midlet, filter);
    Would be one example for the NFC Forum external type. To make it short: The connection string is the same as for static registration.

Similar Threads

  1. Nokia 6131 NFC - Push registry on SE event
    By david.auquiere in forum Mobile Java General
    Replies: 0
    Last Post: 2008-08-07, 10:36
  2. messaqge connection and push registry
    By prashantpersistent in forum Mobile Java General
    Replies: 3
    Last Post: 2008-07-29, 20:26
  3. Is there any way to find application launched by user or push registry.
    By mmdfarook in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2008-06-11, 12:54
  4. Nokia 6255:query related to push registry
    By mitesh852 in forum Mobile Java General
    Replies: 0
    Last Post: 2006-01-19, 14:26
  5. Please HELP! Push Registry on signed MIDlet
    By johnbutler in forum Mobile Java General
    Replies: 7
    Last Post: 2005-11-23, 15:48

Posting Permissions

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