×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 177

Hybrid View

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    31

    6131 NFC autostart on tag touch

    Hi,

    i'm trying to add a push-registry entry to autostart a midlet if a simple tag (not only ndef) is touched but it doesn't work. I tried a lot:

    ndef:rtd?name=urn:nfc:wkt:RFID_TAG
    ndef:rtd?name=urn:nfc:wkt:T

    What else can I try? Which entry works?

    I also tried to autostart a midlet on secure-element events. Looks like this:

    secure-element:?aid=63646530316d6672

    Also doesn't work...

    Maybe you can help.

    Thanks

  2. #2
    Regular Contributor
    Join Date
    Mar 2007
    Location
    Helsinki, Finland
    Posts
    91

    Re: 6131 NFC autostart on tag touch

    If you want your MIDlet to be launched only when a simple tag is touched, you need to add a filter to the PushRegistry entry. Here's is an example:

    PushRegistry.registerConnection("ndef:rtd?name=urn:nfc:wkt:T", "TestMIDlet", "nfc:ndef;type=simpletag;uid=*");

    For the secure element push, please see the following thread:

    http://discussion.forum.nokia.com/fo...d.php?t=107605
    Raluca Cindrea
    Helsinki, Finland
    www.nokia.com/nfc

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    21

    Re: 6131 NFC autostart on tag touch

    Is it possible to read the NDEFMessage from the tag that started the MIDlet?

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Location
    Helsinki, Finland
    Posts
    91

    Re: 6131 NFC autostart on tag touch

    Quote Originally Posted by jorgenaasland
    Is it possible to read the NDEFMessage from the tag that started the MIDlet?
    Yes, this is possible. Please see the following thread for information on how to do this:

    http://discussion.forum.nokia.com/fo...d.php?t=105707

    Please let me know if you need more details.
    Raluca Cindrea
    Helsinki, Finland
    www.nokia.com/nfc

  5. #5
    Registered User
    Join Date
    Mar 2007
    Posts
    130

    Re: 6131 NFC autostart on tag touch

    How to find out that MIDlet was auto started by PushRegistry tag reading. I tried the following code

    String[] connections = PushRegistry.listConnections(true);

    if (connections != null && connections.length > 0) {.....

    But connections was null.

  6. #6
    Registered User
    Join Date
    Oct 2006
    Location
    Berlin
    Posts
    201

    Re: 6131 NFC autostart on tag touch

    Code:
    PushRegistry.registerConnection("ndef:rtd?name=urn:nfc:wkt:T", "TestMIDlet", "nfc:ndef;type=simpletag;uid=*");
    = ERROR = not correctly with jadfiles

    Code:
      DiscoveryManager.getInstance().addTargetListener(this, TargetType.NDEF_TAG); // NDEF Tag's
    for registry the Listener.

    My Thread with PushRegistry
    http://discussion.forum.nokia.com/fo...d.php?t=107134

  7. #7
    Regular Contributor
    Join Date
    Mar 2007
    Location
    Helsinki, Finland
    Posts
    91

    Re: 6131 NFC autostart on tag touch

    Quote Originally Posted by Alex_Polt
    How to find out that MIDlet was auto started by PushRegistry tag reading. I tried the following code

    String[] connections = PushRegistry.listConnections(true);

    if (connections != null && connections.length > 0) {.....

    But connections was null.
    You can find out if the MIDlet was auto-launched by using the DiscoveryManager LaunchType property. The values for LauchType are "touch" or "manual" and you can use this for checking how the MIDlet was launched.

    If the value is "touch" then the MIDlet launch was caused by a JSR-257 PushRegistry connection, e.g. by touching a tag that contained a specific NDEF record.

    I hope this helps.
    Raluca Cindrea
    Helsinki, Finland
    www.nokia.com/nfc

  8. #8
    Registered User
    Join Date
    Sep 2007
    Posts
    40

    Re: 6131 NFC autostart on tag touch

    Quote Originally Posted by Raluca_ View Post
    Yes, this is possible. Please see the following thread for information on how to do this:

    http://discussion.forum.nokia.com/fo...d.php?t=105707

    Please let me know if you need more details.
    Hello Raluca, I wanted to have something clear: Once my registered push application detects a matching target and NDEFRecord, will these NDEFRecord's get read immediately to display in a form? or should I touch the card again?

  9. #9
    Registered User
    Join Date
    Jul 2008
    Posts
    1

    Re: 6131 NFC autostart on tag touch

    Hi.

    Iam beginner. and i have started learning autostart on tag touch but i dont have a real device , so anybody known about a emulator can test push registry?.

    Thanks

    Vu

  10. #10
    Registered User
    Join Date
    Feb 2006
    Posts
    22

    Re: 6131 NFC autostart on tag touch

    Dear all,
    I am trying to make my application start upon tags touches.
    I am using a 6212 and as tags the ones that come into the boc. I do not know which types are they

    In the following there is the code I use for initialize the NFC and the push registry.
    The application gets intalled and asks me for permission to autostart.
    However, if I try to touch the tag when the application is not running, the app won't start, but the phone will read the tag as a note.

    The tag simply contains a string "hello".

    Code:
    void initNFC()
    {
                dm = DiscoveryManager.getInstance();
                try {
                    dm.addTargetListener(this, TargetType.NDEF_TAG);
                    dm.addNDEFRecordListener(this, new NDEFRecordType(
                            NDEFRecordType.MIME, "Text/Plain"));
                   PushRegistry.registerConnection("ndef:mime?name=Text/Plain",this.getClass().getName(), "*");
                    
                } catch (Exception e) {
                    form.append("EX: "+e.toString());
                    form.addCommand(exitCommand);
                    form.setCommandListener(this);
                    d.setCurrent(form);
                }
    }
    Any idea?

  11. #11
    Registered User
    Join Date
    Oct 2006
    Posts
    182

    Re: 6131 NFC autostart on tag touch

    Hi,

    you need to create a tag with mime format as text/plain, since you are registering a push for that mime format.

    please try with a static push entry in your application JAD file also. like "MIDlet-Push-1: ndef:mime?name=text/plain, com.yourcomp.yourmidlet, *"

    regards
    sunil

  12. #12
    Registered User
    Join Date
    Nov 2009
    Posts
    23

    Re: 6131 NFC autostart on tag touch

    Quote Originally Posted by giaperrucci View Post
    Dear all,
    I am trying to make my application start upon tags touches.
    I am using a 6212 and as tags the ones that come into the boc. I do not know which types are they

    In the following there is the code I use for initialize the NFC and the push registry.
    The application gets intalled and asks me for permission to autostart.
    However, if I try to touch the tag when the application is not running, the app won't start, but the phone will read the tag as a note.

    The tag simply contains a string "hello".

    Code:
    void initNFC()
    {
                dm = DiscoveryManager.getInstance();
                try {
                    dm.addTargetListener(this, TargetType.NDEF_TAG);
                    dm.addNDEFRecordListener(this, new NDEFRecordType(
                            NDEFRecordType.MIME, "Text/Plain"));
                   PushRegistry.registerConnection("ndef:mime?name=Text/Plain",this.getClass().getName(), "*");
                    
                } catch (Exception e) {
                    form.append("EX: "+e.toString());
                    form.addCommand(exitCommand);
                    form.setCommandListener(this);
                    d.setCurrent(form);
                }
    }
    Any idea?
    The tag with "Hello" is probably not a MIME type with "Text/Plain" but a tag with an NFC define "Text" RTD type.

    So, your recordType you should register for would be NDEFRecordType.NFC_FORUM_RTD, "urn:nfc:wkt:T" where the "T" is for the Text RTD defined by NFC Forum.

  13. #13
    Registered User
    Join Date
    Feb 2009
    Posts
    17

    Re: 6131 NFC autostart on tag touch

    Hi everyone and thanks for your very helpful post!

    I'm trying also to start the Midlet with my Tag, but I don't understand how to format a Tag in MIME format and which data corresponding to my Midlet I have to write in it...

    Here's my code for writing my tag :

    String url = detectedTarget[i].getUrl(Class.forName("javax.microedition.contactless.ndef.NDEFTagConnection"));

    conn = (NDEFTagConnection) Connector.open(url);
    NDEFRecordType myType = new NDEFRecordType(NDEFRecordType.NFC_FORUM_RTD,"urn:nfc:wkt:T");
    NDEFRecord myRec;

    myRec = new NDEFRecord(myType, null, data);
    NDEFRecord[] myRecArray = new NDEFRecord[] {myRec };
    NDEFMessage myMessage = new NDEFMessage(myRecArray);
    conn.writeNDEF(myMessage);

    But when I did so it doesn't launch my midlet but save a note with the byteArray data passed in myRec...

    Could someone explain this MIME format thing? Thanks a lot

    Antoine

  14. #14
    Registered User
    Join Date
    Sep 2007
    Posts
    40

    Re: 6131 NFC autostart on tag touch

    Quote Originally Posted by ant.pitel View Post
    Hi everyone and thanks for your very helpful post!

    I'm trying also to start the Midlet with my Tag, but I don't understand how to format a Tag in MIME format and which data corresponding to my Midlet I have to write in it...

    Here's my code for writing my tag :

    String url = detectedTarget[i].getUrl(Class.forName("javax.microedition.contactless.ndef.NDEFTagConnection"));

    conn = (NDEFTagConnection) Connector.open(url);
    NDEFRecordType myType = new NDEFRecordType(NDEFRecordType.NFC_FORUM_RTD,"urn:nfc:wkt:T");
    NDEFRecord myRec;

    myRec = new NDEFRecord(myType, null, data);
    NDEFRecord[] myRecArray = new NDEFRecord[] {myRec };
    NDEFMessage myMessage = new NDEFMessage(myRecArray);
    conn.writeNDEF(myMessage);

    But when I did so it doesn't launch my midlet but save a note with the byteArray data passed in myRec...

    Could someone explain this MIME format thing? Thanks a lot

    Antoine
    Hi Ant, do you know if once my registered push application detects a matching target and NDEFRecord, will these NDEFRecord's get read immediately to display in a form? or should I touch the card again?

  15. #15
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: 6131 NFC autostart on tag touch

    Hallo,

    Quote Originally Posted by juancarlosr View Post
    Do you know if once my registered push application detects a matching target and NDEFRecord, will these NDEFRecord's get read immediately to display in a form? or should I touch the card again?
    Yes, these records are read on the first touch. Upon start your "NDEF pushed" application should immediately register an NDEFRecordListener for the record type that triggered the PushRegistry. Then the recordDetected(NDEFMessage) callback will receive the NDEFMessage that caused the application start.

    br,
    Michael

Similar Threads

  1. Autostart application and reading tag UID with one touch
    By choege in forum Near Field Communication
    Replies: 6
    Last Post: 2010-02-22, 12:38
  2. Communication between 2 Nokia 6131 NFC
    By zhs_bravo in forum Near Field Communication
    Replies: 13
    Last Post: 2009-01-05, 10:23
  3. TargetListener Problems in nokia 6131 NFC
    By JesusFD in forum Near Field Communication
    Replies: 3
    Last Post: 2008-03-31, 11:52
  4. Nokia 6131 NFC SDK 1.0 has been released
    By Nokia Ron in forum Near Field Communication
    Replies: 0
    Last Post: 2007-03-26, 22:28
  5. Can't read RFID Tag with NFC Shell
    By begermic in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2007-01-31, 23:02

Posting Permissions

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