Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. NFC QML
QtWS25 Last Chance

NFC QML

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Milad90
    wrote on last edited by
    #1

    Hello I would just like to know if there is a way to use QML to create a communication between two phones. So basically one phone is to be used as a tag and the other as reader and then vice versa. Please if anyone can show a clear example on how to use the new Qt Mobility 1.2.1 NFC QML elements as seen on this link:
    http://doc.qt.nokia.com/qtmobility-1.2/connectivity-api.html#nfc

    Thank you in advance.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kahon
      wrote on last edited by
      #2

      It is an example how to connect two devices by NFC.

      @ import QtQuick 1.0
      import QtMobility.connectivity 1.2

      Item {
      id: root

       property BluetoothService bluetoothService
       property bool available : false
      
       NearFieldSocket {
           id: socket
      
           uri: "urn:nfc:sn:com.nokia.qtmobility.tennis"
           connected: true
      
           function parse(s) {
               var args = s.split(" ");
               if (args.length == 2) {
                   bluetoothService.deviceAddress = args[0];
                   bluetoothService.servicePort = args[1];
                   root.bluetoothServiceChanged();
               }
           }
      
           onDataAvailable: parse(socket.stringData)
      
           onStateChanged: {
               if (state == "Connecting") {
                   available = true;
               }
           }
       }
      

      }
      @
      It is in Tennis QML example.
      I hope it is heplfull for you.
      Best.
      Fernando Moreno

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Milad90
        wrote on last edited by
        #3

        This example I saw but I want to know what are the important things to have to make sure the connection is working or that it will work no matter what

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved