Discussion Board

Results 1 to 7 of 7
  1. #1
    Hi,

    Can any tell me, how can I tag two Nokia C7-00 devices by NFC using Java API?

    Is there any demo app that can establish NFC connection between two Nokia C7-00 devices ?

    Thanks

  2. #2
    Super Contributor mahbub_s60's Avatar
    Join Date
    Mar 2008
    Posts
    1,481
    According to this looks we can have peer to peer connection
    http://www.developer.nokia.com/Commu...131_NFC_-_FAQs

    See Does the Nokia 6131 NFC SDK support NFCIP-1 connection? If so, how can I use that?
    Java API works with C7 so we can built example easily, try...

  3. #3
    import javax.microedition.contactless.ContactlessException;
    import javax.microedition.contactless.DiscoveryManager;
    import javax.microedition.contactless.TargetListener;
    import javax.microedition.contactless.TargetProperties;
    import javax.microedition.contactless.TargetType;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Form;
    import javax.microedition.lcdui.TextField;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;

    // Simple MIDlet to read the serial number of NDEF tag
    public class ReadSerial extends MIDlet implements TargetListener {

    private Form form;
    private TextField textField;

    protected void startApp() throws MIDletStateChangeException {
    // Get instance of NFC Discovery Manager
    DiscoveryManager dm = DiscoveryManager.getInstance();

    // Register NDEF_TAG target to discovery
    try {
    dm.addTargetListener(this, TargetType.NDEF_TAG);
    } catch (IllegalStateException e) {
    // Catch IllegalStateException
    } catch (ContactlessException e) {
    // Catch ContactlessException
    }

    // Initialize and show user interface elements
    form = new Form("ReadSerial");
    textField = new TextField("Unique identifier:", "", 0, TextField.UNEDITABLE);
    form.append(textField);
    Display.getDisplay(this).setCurrent(form);
    }

    protected void pauseApp() {
    }

    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
    }

    public void targetDetected(TargetProperties[] prop) {
    // Set unique identifier of the detected target on the Text Field
    textField.setString(prop[0].getUid());
    }

    }


    Its a simple tag reader app to find out uid of tag writer, but still its not working on two C7 devices....

  4. #4
    Super Contributor mahbub_s60's Avatar
    Join Date
    Mar 2008
    Posts
    1,481
    Hi,

    You can see working example from this page http://www.developer.nokia.com/Commu..._Code_Examples and compare your one to find the problem

  5. #5
    I have tried all these example between two Nokia C7-00 devices but none of them were working... Can u suggest me any other solution?

  6. #6
    Super Contributor mahbub_s60's Avatar
    Join Date
    Mar 2008
    Posts
    1,481
    At least Symbian C++ examples work for sure. I have done some test. But I have not used J2ME much.
    Does it help you if you use Qt/QML/Symbian C++? These gives you more control over the device.

  7. #7
    Registered User mroland's Avatar
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121
    Hallo,

    the C7 cannot operate as NFC tag. Therefore, your code (TargetListener) will not work for your scenario. I don't know if peer-to-peer communication is supported in the C7's Java implementation, but as mahbub suggests, you can stick to Qt, ...

    br
    Michael

Similar Threads

  1. Replies: 5
    Last Post: 2012-03-09, 00:36
  2. C7-00 NFC enable
    By gavdian in forum Near Field Communication
    Replies: 3
    Last Post: 2011-06-29, 19:03
  3. Stall on C7-00_1: What's the difference between C7-00_1 and C7-00?
    By diorahman in forum [Closed] Publishing to Nokia Store
    Replies: 10
    Last Post: 2011-03-03, 15:07
  4. C3-00 Communicatuion error and C6-00, C7-00, N8-00, C5-00 Temporary services error
    By Digamber.Singh in forum General Development Questions
    Replies: 0
    Last Post: 2011-02-18, 10:30
  5. can Nokia 6131 NFC supports any consumer based RFID tag
    By kushalkaranjkar in forum Near Field Communication
    Replies: 6
    Last Post: 2008-12-20, 00:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved