main.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
  3. * All rights reserved.
  4. * This component and the accompanying materials are made available
  5. * under the terms of "Eclipse Public License v1.0"
  6. * which accompanies this distribution, and is available
  7. * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8. *
  9. * Initial Contributors:
  10. * Nokia Corporation - initial contribution.
  11. *
  12. * Contributors:
  13. *
  14. * Description: Main.
  15. */
  16. /*!
  17. * \file
  18. * \brief Declaration of the main() function for the Qt NFC NPP Example
  19. * application.
  20. */
  21. /*! \mainpage NFC NPP Example application.
  22. *
  23. * \section intro_sec Introduction
  24. *
  25. * The NFC NPP Example is a sample application that demonstrates how to
  26. * use the NFC LLCP protocol to create a peer-to-peer connection between two
  27. * NFC enabled devices and how to send and receive NDEF messages between a Symbian
  28. * and an Android device. NDEF messages containing NFC Text records or NFC URI
  29. * records as defined in NFC Forum specifications can be sent and received.
  30. *
  31. * Android uses NDEF Push Protocol to format the NDEF messages sent between two
  32. * Android devices. The NFC NPP Example application demonstrates how to create and
  33. * parse NPP compliant messages to be able to communicate with an Android device.
  34. *
  35. * A custom-made Qt Quick user interface uses a toggle button to switch between
  36. * NFC Text or NFC URI record types and a simple listview to show the received messages
  37. * on the screen. The "Send" button stores the message into a buffer. Buffer is then
  38. * sent when devices are brought close to each other. Also a "Message sent." dialog,
  39. * is shown when the devices have connected and the message has been sent.
  40. *
  41. * The C++ class NfcNppExample is responsible for listening for NFC targets and
  42. * establishing an LLCP socket connection to the client. An LLCP server is waiting for
  43. * incoming connections at a specified URI and then provides a socket to read data
  44. * from the client. It also parses and creates the NDEF Push Protocol messages sent
  45. * between the Symbian and Android device.
  46. *
  47. * \section capability_sec Required capablities
  48. * The application can be self-signed.
  49. *
  50. * \section knownissues_sec Known issues
  51. * Symbian does not yet support the "com.android.npp" service URI.
  52. *
  53. * If the selected link does not open in the Symbian device, check that the browser is
  54. * not already running. If it is, close it and activate the link again. This is a drawback
  55. * caused by the application not having the SwEvent capability. Adding the capability
  56. * would require the installation package to be signed with a developer certificate,
  57. * and self-signing would no longer be possible.
  58. *
  59. * \section build_install_sec Building and installation
  60. *
  61. * \subsection build_and_installation_preparations_subsec Preparations
  62. *
  63. * Check that you have the latest Qt/Qt SDK installed in the development environment
  64. * and on the device. Qt SDK 1.1 or later is required.
  65. *
  66. * Additionally, create a target for Qt 4.7.3 and Qt Mobility 1.2
  67. * for Symbian^3 following the instructions from:
  68. * https://projects.forum.nokia.com/QtM12bSymb
  69. *
  70. * Make sure you have a C7-00 with Symbian Anna Firmware to test.
  71. * The application can be self-signed.
  72. *
  73. * \subsection build_and_installation_qt_sdk_subsec Build & installation instructions using Qt SDK
  74. *
  75. * <ol>
  76. * <li>
  77. * Open nfcnppexample.pro by selecting the File > Open File or Project, browse
  78. * to the location where you unpacked the sample application and select nfcnppexample.pro.
  79. * </li>
  80. * <li>
  81. * Select the "Qt 4.7.3 for Symbian^3 with QtM1.2b" target and press the Finish button.
  82. * </li>
  83. * <li>
  84. * Ensure your NFC enabled Symbian device is connected to the development PC
  85. * via USB and that is shows up as connected in Qt Creator (i.e. the build
  86. * target selection button in the lower left corner shows a Symbian Device
  87. * with a green checkbox).
  88. * </li>
  89. * <li>
  90. * Press the Run button to build the project and create the nfcnppexample.sis
  91. * Symbian install package. The application is installed and run on the device.
  92. * </li>
  93. * </ol>
  94. *
  95. * \subsection build_and_installation_command_prompt_subsec Build & installation instructions using the Command Prompt
  96. *
  97. * <ol>
  98. * <li>
  99. * Open Qt SDK command prompt from the Start menu by selecting Start > All
  100. * Programs > Qt SDK 1.1 > Symbian^3 Qt 4.7.3 > Qt 4.7.3 for Symbian^3 Command Prompt.
  101. * </li>
  102. * <li>
  103. * In the directory where nfcnppexample.pro is located use the following
  104. * commands to build the application and to create the installation package:
  105. * \code
  106. * >qmake
  107. * >sbs -c armv5_gcce
  108. * >createpackage -g nfcnppexample_template.pkg release-gcce
  109. * \endcode
  110. * </li>
  111. * <li>
  112. * Nokia Ovi Suite is required to deploy the created installation package
  113. * into the device. Double click the created nfcnppexample.sis file in
  114. * Windows Explorer or use the createpackage command with -i option. Both
  115. * start the installation process.
  116. * </li>
  117. * </ol>
  118. *
  119. * \section usage_sec Usage
  120. *
  121. * You must have one Symbian NFC enabled device that has NfcNppExample application
  122. * installed and one Android Nexus S device that has the NfcNppExample Android
  123. * counterpart application installed.
  124. *
  125. * To establish a connection between devices, start the applications on both devices and
  126. * bring devices close to each other. The "Message sent." dialog is shown on successful
  127. * connection and data exchange.
  128. *
  129. * The content of the sent NDEF message can be toggled between NFC Text record and NFC URI
  130. * record. The default data for the record type changes accordingly. To change the data,
  131. * tap the text editor and write a new value. Press the "Send" button to buffer the data.
  132. * Bring the devices close to each other to send the message.
  133. *
  134. * Received messages are shown on the scrolling view. Received NFC URI record links can
  135. * be opened in the browser by tapping on them.
  136. *
  137. *
  138. * \section compatibility_sec Compatibility
  139. *
  140. * This sample application has been tested using the following hardware and
  141. * software:
  142. *
  143. * <ul>
  144. * <li>Nokia C7-00 with Symbian Anna Firmware</li>
  145. * <li>Nokia Qt SDK 1.1</li>
  146. * <li>QtMobility 1.2 Beta1</li>
  147. * </ul>
  148. *
  149. * \section change_history_sec Change history
  150. *
  151. * 1.0 First version
  152. *
  153. * \section references_sec References
  154. *
  155. * NFC: http://www.forum.nokia.com/NFC
  156. *
  157. * Qt for Symbian: http://qt.nokia.com/downloads
  158. */
  159. #ifndef MAIN_H
  160. #define MAIN_H
  161. /*!
  162. * \fn int main(int argc, char *argv[])
  163. * \brief The <code>main()</code> function for the Qt NFC NPP Example application.
  164. *
  165. * Constructs the declarative main view of the application and starts the Qt event loop.
  166. */
  167. int main(int argc, char *argv[]);
  168. #endif // MAIN_H