×

Discussion Board

Page 3 of 12 FirstFirst 123456789101112 LastLast
Results 31 to 45 of 177
  1. #31
    Regular Contributor
    Join Date
    Mar 2007
    Location
    Helsinki, Finland
    Posts
    91

    Re: 6131 NFC autostart on tag touch

    First of all, can you please tell me - do you want to autolaunch your MIDlet with any tag or do you want to autolaunch it with a tag that has a specific url ("urn:nfc:wkt:RFID_TAG") written to it?

    Also, please see my other questions and comments:

    The entries in the Push Registry represent the possibility of starting the program with the help of a causer. But not the function of reading the ' TAG ' data.
    So you only want to autolaunch the MIDlet and you don't need to read the data on the tag - is this correct?
    _________________________________________________________________


    From this follows.

    in .JAD -File
    ndef:rtd?name=urn:nfc:wkt:RFID_TAG
    Let's try to see if you can get this to work if you do everything in the code first.
    Remove the entry from the .jad file and register your connection in the code, just like you have done in the sample code you posted here yesterday.
    _________________________________________________________________



    in Code
    DiscoveryManager.getInstance().addTargetListener( this, TargetType.RFID_TAG );
    This is correct, but it is not enough. You also need to add an NDEFTargetListener to you DiscoveryManager, like I said in my previous post:
    DiscoveryManager.getInstance().addNDEFRecordListener(this, new NDEFRecordType(NDEFRecordType.NFC_FORUM_RTD, "urn:nfc:wkt:RFID_TAG"));
    _________________________________________________________________



    no entry in code = no read the tag = in the real-hardware -> Unknown service type.
    I'm not sure what you mean here....
    If you get the "Unknown service type" message when you try to launch your MIDlet and you touch a tag, this means that the tag you are touching contains the wrong data.
    This could be because your tag doesn't contain the "urn:nfc:wkt:RFID_TAG" url.
    _________________________________________________________________



    If the entry would not be correct in the PushRegistry, also the program does not become executable after the installation. Since the installation also with wrong entries is accomplished.

    therefore
    Filter necessarily for 'TAG' not = all TAG's read = no problem = if RFID_TAG
    (Sender IP/Filter = nfc:rf;type=simpletag;uid=* -> Invalid filter thrown java.lang.IllegalArgumentException: Filter invalid java.lang.SecurityException: Application not authorized to access the restricted API)
    Yes, if you try to run your MIDlet on the emulator and have a Push Registry entry that has a filter, you get the "Invalid filter thrown java.lang.IllegalArgumentException: Filter invalid". This is an issue in the current SDK release and it will be fixed for future releases.
    Please try your MIDlet on a real device.
    _________________________________________________________________



    For the program it is to be switched on not necessarily those the internal NFC function. Whether you switched off or switched on is, does not play a role.
    Only for the autostart it is important?
    Tag detection must be ON on the phone.
    If you switch if off, autolaunch cannot work.
    _________________________________________________________________

    I will try to help more if I can have the answer to these questions.
    Also, please take a look at the new NFC Java Code Examples page on Forum Nokia Wiki. There are a couple of examples regarding Push Registry on that page:
    http://wiki.forum.nokia.com/index.ph..._Code_Examples
    Raluca Cindrea
    Helsinki, Finland
    www.nokia.com/nfc

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

    Re: 6131 NFC autostart on tag touch

    Hello

    First of all, can you please tell me - do you want to autolaunch your MIDlet with any tag or do you want to autolaunch it with a tag that has a specific url ("urn:nfc:wkt:RFID_TAG") written to it?
    My goal is:
    Install for application.
    Touch the TAG.
    Start of application.
    TAG data read.
    Data transmit.
    over JAD Entrys
    and not over code.

    So you only want to autolaunch the MIDlet and you don't need to read the data on the tag - is this correct?
    autolaunch the midlet
    From this follows the start width unit Midlets with startApp()
    and
    DiscoveryManager.getInstance().addTargetListener(this, TargetType.NDEF_TAG)
    and
    public void targetDetected(TargetProperties[] properties)
    and
    read data from TAG (UID only , no NDEF Message)

    Let's try to see if you can get this to work if you do everything in the code first.
    Remove the entry from the .jad file and register your connection in the code, just like you have done in the sample code you posted here yesterday.
    The code for read the TAG UID = no problem.
    As already said, the program functions perfectly. It goes reaching me alone therefore the autostart now

    I'm not sure what you mean here....
    If you get the "Unknown service type" message when you try to launch your MIDlet and you touch a tag, this means that the tag you are touching contains the wrong data.
    This could be because your tag doesn't contain the "urn:nfc:wkt:RFID_TAG" url.
    entry in .jad with
    Connection String
    = ndef:rtd?name=urn:nfc:wkt:RFID_TAG
    and
    Sender IP
    = nfc:rf;type=simpletag;uid=*
    -> Error in realdevice
    Sender IP
    = nfc:ndef;type=simpletag;uid=*
    -> OK in realdevice

    For the program it is to be switched on not necessarily those the internal NFC function. Whether you switched off or switched on is, does not play a role.
    Only for the autostart it is important?
    NFC function on = autolaunch true
    NFC function off = autolaunch false
    and run midlet
    = NFC off or on = no meaning has, then in code addTargetListener for TAG Read.

    Again Push Registry.
    Push Registry in the program code does not have any effect in registration, if PsuhRegistry.listConnections(false);
    in code
    ndef:rtd?name=urn:nfc:wkt:RFID_TAG
    =
    in jad
    ndef:rtd?name=urn:nfc:wkt:RFID_TAG

    in code
    filter
    nfc:ndef;type=simpletag;uid=*
    in jad
    filter
    nfc:ndef;type=simpletag;uid=*

    with jad or code = no autostart with NFC function on or off.

    Nokia 6131 NFC (Nokia 6131x [RM-216] Firmware 3.12)
    hardware error in device?
    firmware error in device?

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

    Re: 6131 NFC autostart on tag touch

    One more question:

    When you try to launch your MIDlet, do you use a MiFare Ultralight tag that has the "urn:nfc:wkt:RFID_TAG" url written on it?
    Raluca Cindrea
    Helsinki, Finland
    www.nokia.com/nfc

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

    Re: 6131 NFC autostart on tag touch

    All in real 6131 NFC
    (* = UID)
    getUrl
    1.
    for MifareUltraLight
    - nfc:ndef;type=simpletag;uid=*
    = NDEF_TAG & RFID_TAG
    2.
    for Mifare 4k
    - nfc:ndef;type=mf4k;uid=*
    = NDEF_TAG
    3.
    for Mifare 1K
    - nfc:ndef;type=mf1k;uid=*
    = NDEF_TAG

    in jad
    MIDlet-Push-1: ndef:rtd?name=urn:nfc:wkt:RFID_TAG,XXXXMidlet,nfc:ndef;type=simpletag;uid=*
    MIDlet-Push-2: ndef:rtd?name=urn:nfc:wkt:NDEF_TAG,XXXXMidlet,*

    MIDlet-Permissions: javax.microedition.io.Connector.http, javax.microedition.io.PushRegistry, javax.microedition.contactless.DiscoveryManager, javax.microedition.io.Connector.ndef, javax.microedition.io.Connector.rf, javax.microedition.io.Connector.sc

    NFC function on = Unknown service type

    install = no problem
    handstart = working = no problem with TAG
    Last edited by mariosas; 2007-06-15 at 12:39.

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

    Re: 6131 NFC autostart on tag touch

    You need to write the url you are using in your Push Registry entry ("urn:nfc:wkt:RFID_TAG") to the tag you are going to use to launch your MIDlet.

    The autostart will not and is not supposed to work if you try it with any tag.

    Do you have any NDEF record on the tag you are using for launching the MIDlet? Or is it an empty tag?

    If you want to launch your MIDlet with any (empty) tag, you need to look at the instructions I wrote for cde earlier in this thread.
    Raluca Cindrea
    Helsinki, Finland
    www.nokia.com/nfc

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

    Re: 6131 NFC autostart on tag touch

    Hello.

    You need to write the url you are using in your Push Registry entry ("urn:nfc:wkt:RFID_TAG") to the tag you are going to use to launch your MIDlet.
    the url in code and jad
    MIDlet-Push-1: ndef:rtd?name=urn:nfc:wkt:RFID_TAG,XXXXMidlet,nfc:ndef;type=simpletag;uid=*
    If the entry were not correct and is, the installation with error is terminated.
    then in code registry with
    DiscoveryManager.getInstance().addTargetListener(this, TargetType.NDEF_TAG); // NDEF Tag's
    or
    DiscoveryManager.getInstance().addTargetListener(this, TargetType.RFID_TAG); // RFID Tag's
    Exactly the same.
    Why?
    while in my example
    Code:
      iMessage += "getURL(\n"+properties[i].getUrl()+")\n";  // URL from TAG
    = nfc:ndef;type=simpletag;uid=* -> * = UID
    if * not correct then no install the midlet.
    or
    in jad file for Connection String
    = ndef:rtd?name=urn:nfc:wkt:RFID_TAG
    if nfc:ndef;type=simpletag;uid=*
    in Connection String = Error.
    Each still so wrong or probably correct entry in the Jad is rejected.
    then in code
    Code:
     iConnectionName = properties[i].getConnectionNames();
    is the name of the interface for TAG-Type (for Mifare UL)
    interface:
    com.nokia.nfc.nxp.simpletag.SimpleTagConnection
    and
    javax.microedition.contactless.ndef.NDEFTagConnection

    But in the emulator the filter is rejected
    nfc:ndef;type=simpletag;uid=*
    ????

    For the UID read from the TAG are necessary no further interfaces.

    The whole is called for me, waits for an update for the SDK and for the hardware.
    Thanks all
    and
    You Raluca_

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

    Re: 6131 NFC autostart on tag touch

    the url in code and jad
    MIDlet-Push-1: ndef:rtd?name=urn:nfc:wkt:RFID_TAG,XXXXMidlet,nfc:ndef;type=simpletag;uid=*
    Make sure you add the package name too in the MIDlet Push .jad file entry. For example:

    MIDlet-Push-1: ndef:rtd?name=urn:nfc:wkt:RFID_TAG,com.nokia.nfc.sample.app.TestMidlet,nfc:ndef;type=simpletag;uid=*

    This entry in the .jad file works just fine for me.

    Why?
    while in my example
    Code:
      iMessage += "getURL(\n"+properties[i].getUrl()+")\n";  // URL from TAG
    = nfc:ndef;type=simpletag;uid=* -> * = UID
    if * not correct then no install the midlet.
    I think you confuse the url you use in your code to get a connection to a tag with the url that you add in your Push Registry entry.

    The getUrl() method from TargetProperties returns the url that can be used to open a connection to a tag.

    The url you specify in your .jad file when you register your entry for Push Registry is a different thing and this url (in your case "urn:nfc:wkt:RFID_TAG") needs to be written on the tag that you later use to launch the MIDlet.

    To write this on your tag, you can use the following code:

    Code:
    private class WriteNdefThread implements Runnable {
            public void run() {
            	long duration = System.currentTimeMillis();
            	boolean supported = false;
                for (int i = 0; i < detectedTarget.length; i++) {
                    if (detectedTarget[i].hasTargetType(TargetType.NDEF_TAG)) {
                    	supported = true;
                        try {
                            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:RFID_TAG");
                            NDEFRecord myRec;
    
                            
                            myRec = new NDEFRecord(myType, null, fillAndReturnArray(contentlength, useNokiaContent));
                            
                            NDEFRecord[] myRecArray = new NDEFRecord[] {myRec};
    
                            NDEFMessage myMessage = new NDEFMessage(myRecArray);
                            conn.writeNDEF(myMessage);
                            screenText2.setText("\n\n" + myMessage.toByteArray().length + " bytes written");
                            break;
                        } catch (ContactlessException e) {
                            
                        } catch (IOException e) {
                            
                        } catch (Exception e) {
                           
                        }
                    }
                }
    Raluca Cindrea
    Helsinki, Finland
    www.nokia.com/nfc

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

    Re: 6131 NFC autostart on tag touch

    Hello.
    Thanks for code.

    (The problem is not the read data or write data to TAG)
    final autostart with .jad file after install.
    my class in push registry is correct.
    testing with autostart over Push Registry over timer.

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

    Re: 6131 NFC autostart on tag touch

    Quote Originally Posted by mariosas
    Hello.
    Thanks for code.

    (The problem is not the read data or write data to TAG)
    final autostart with .jad file after install.
    my class in push registry is correct.
    testing with autostart over Push Registry over timer.
    The autostart will not work right after installation. You have to:
    1. install the MIDlet that has the Push Registry entry in the .jad file
    2. start it manually once
    3. exit the MIDlet
    4. try to auto-start it by touching a tag that contains the correct NDEF record on it.

    Please let me know if it works after you try that.
    Raluca Cindrea
    Helsinki, Finland
    www.nokia.com/nfc

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

    Re: 6131 NFC autostart on tag touch

    the RecordType is RFID_TAG
    the URL is nfc:ndef;type=simpletag;uid=1233243454345
    then
    No new record to TAG with Message?!
    NFC Function with this type 'unknown service type'
    It is not at the entry, but because of the type.
    the NFC Funtion and no midlet = error with 'unknown service type'?!

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

    Re: 6131 NFC autostart on tag touch

    I have one TAG found with that the MIDlet start automatically.
    I have approx. 25 pieces of different design and types tested nfc:ndef;type=simpletag;uid=XXXXXX RFID_TAG
    ????
    No notion why? The data examination resulted in the same characteristics as many different out and you was not before described.

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

    Re: 6131 NFC autostart on tag touch

    Solution found.

    - after midlet install with Push Registry entrys
    - no userlaunch
    - NFC function = ON

    Empty TAG (no first write or more)
    = Error with 'unknown service type' message
    = first write with NFC device function
    - Text message (autostart with midlet = true)
    or
    - Bookmark (browser start with internetadress = no midlet autolaunch)
    or
    - Business card (CARD to Tag with > 1kByte = no midlet autolaunch)
    or
    - Call request (Call Telefonnumber = no midlet autolaunch)

    autolaunch with Text message = true and start the midlet

    Text message (minimum):
    To = '1'
    Message = '' [clean]
    Text Message title = '' [clean]
    Touch the TAG and ok

    = autolaunch midlet with TAG working
    = first touch = start the midlet
    = second touch = targetDetected(TargetProperties[] properties);


    Empty TAG = 'unknown service type' message =? not good with autostart.
    It would be better if the autostart during contact is accomplished. All the same whether it is an empty TAG or full TAG.

    Production:
    Emptry TAG = low price
    Message TAG = high price

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

    Re: 6131 NFC autostart on tag touch

    Supplement.
    After the installation of the Midlets the possibility functions only if the Midlet were at least started and terminated. Not well.

  14. #44
    Registered User
    Join Date
    Jul 2007
    Posts
    1

    Re: 6131 NFC autostart on tag touch

    hi all can somebody help me pls...where can i get nokia 6131 nfc and 3220 nfc pls i from malaysia its hard to get that gadget...i wish to purchase by online

  15. #45
    Registered User
    Join Date
    Jun 2007
    Posts
    10

    Re: 6131 NFC autostart on tag touch

    Hello Reluca,
    what is fillAndReturnArray(contentlength, useNokiaContent) supposed to be in your example for writing URL on a tag?
    Line:
    NDEFRecordType myType = new myRec = new NDEFRecord(myType, null, fillAndReturnArray(contentlength, useNokiaContent));

    And is it possible to auto-lauch a tag according to its Bookmark?

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