main.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. /*! \mainpage Location sharing application
  17. *
  18. * \section intro_sec Introduction
  19. *
  20. * The Location App is a sample application that demonstrates how to use the NFC
  21. * stack and AIW Framework to pair two NFC enabled devices over Bluetooth and
  22. * use the provided Bluetooth information to create a connection channel between
  23. * the devices. Location data is then shared via established the Bluetooth connection.
  24. *
  25. * The custom Qt Quick user interface of the application uses Qt C++ classes to query and store
  26. * the current location and to share location data with another device. It consists of two
  27. * views, Map view and Bookmark view. Both views use Location QML Plugin to handle
  28. * locations: Map view to show the selected location on the map and Bookmark view to
  29. * access locations stored in the device's landmark database to show them in a simple listview, from
  30. * which locations can be shared by tapping a bookmark item.
  31. *
  32. * The C++ class LocationManager is used to query and store the current position. Whenever
  33. * the cached location changes, the change is signalled to UI. LocationManager
  34. * also constructs/deconstructs the shared location data and handles the storing of the
  35. * shared locations upon receiving. LocationManager is used from within the QML code.
  36. *
  37. * The C++ class ConnectionEngine is used to handle connection initiation and
  38. * location data transfer. ConnectionEngine consists of a Bluetooth client and server
  39. * and AIWEngine. The Bluetooth server listens for client connections. AIWEngine is used
  40. * to start "Easy setup", in which the devices are paired using the NFC channel. The
  41. * Bluetooth information of successful setup is then used to open a Bluetooth connection
  42. * between devices.
  43. *
  44. * \section prerequisites_sec Prerequisites
  45. * Qt and Qt Quick basics.
  46. *
  47. * \section capability_sec Required capabilities
  48. * The application can be self-signed.
  49. *
  50. * \section knownissues_sec Known issues
  51. * Qt Bluetooth is not working correctly. Only one location can be shared between
  52. * devices before the connection dies.
  53. *
  54. * Bluetooth must be enabled in both devices to be able to send location data over Bluetooth.
  55. *
  56. * Declarative_location.dll and declarative_feedback.dll libraries are excluded from
  57. * the Qt Mobility 1.2 Beta1 for Symbian^3 sis package file. These need to be installed
  58. * separately.
  59. *
  60. * Nokia Ovi Maps works only online (phone network or wlan connection required).
  61. *
  62. * \section build_install_sec Building and installation
  63. *
  64. * \subsection build_and_installation_preparations_subsec Preparations
  65. *
  66. * Check that you have the latest Qt/Qt SDK installed in the
  67. * development environment and on the device. Qt SDK 1.1 or later is required.
  68. *
  69. * Additionally, create a target for Qt 4.7.3 and Qt Mobility 1.2
  70. * for Symbian^3 following the instructions from:
  71. * https://projects.forum.nokia.com/QtM12bSymb
  72. *
  73. * Make sure you have a C7-00 with Symbian Anna Firmware to test.
  74. * The application can be self-signed.
  75. *
  76. * Nokia Ovi Maps installation is required to use application, if not
  77. * already included in the device. Nokia Ovi Maps can be installed from:
  78. * http://www.nokia.co.uk/apps-maps-and-more. Finalize the Nokia Ovi Maps installation
  79. * by opening the Maps application from the Menu application.
  80. *
  81. * \subsection build_and_installation_qt_sdk_subsec Build & installation
  82. * instructions using Qt SDK
  83. *
  84. * <ol>
  85. * <li>
  86. * Open LocationApp.pro by selecting the File > Open File or Project, browse
  87. * to the location where you unpacked the sample application and select LocationApp.pro.
  88. * </li>
  89. * <li>
  90. * Select the "Qt 4.7.3 for Symbian^3 with QtM1.2b" target and press the Finish button.
  91. * </li>
  92. * <li>
  93. * Ensure your NFC enabled Symbian device is connected to the development PC
  94. * via USB and that is shows up as connected in Qt Creator (i.e. the build
  95. * target selection button in the lower left corner shows a Symbian Device
  96. * with a green checkbox).
  97. * </li>
  98. * <li>
  99. * Press the Run button to build the project and create the LocationApp.sis
  100. * Symbian install package. The application is installed to the device.
  101. * </li>
  102. * </ol>
  103. *
  104. * \subsection build_and_installation_command_prompt_subsec Build & installation
  105. * instructions using the Command Prompt
  106. *
  107. * <ol>
  108. * <li>
  109. * Open Qt SDK command prompt from the Start menu by selecting Start > All
  110. * Programs > Qt SDK 1.1 > Symbian^3 Qt 4.7.3 > Qt 4.7.3 for Symbian^3 Command Prompt.
  111. * </li>
  112. * <li>
  113. * In the directory, where LocationApp.pro is located use the following
  114. * commands to build and to create installation package:
  115. * \code
  116. * >qmake
  117. * >sbs -c armv5_gcce
  118. * >createpackage -g locationapp_template.pkg release-gcce
  119. * \endcode
  120. * </li>
  121. * <li>
  122. * Nokia Ovi Suite is required to deploy the created installation package
  123. * into the device. Double click the created LocationApp.sis file in
  124. * Windows Explorer or use the createpackage command with -i option. Both
  125. * start the installation process.
  126. * </li>
  127. * </ol>
  128. *
  129. * \section usage_sec Usage
  130. *
  131. * \subsection usage_prerequisite_subsec Usage prerequisite
  132. *
  133. * Two NFC enabled devices that both have the LocationApp installed and
  134. * running are needed to be able to share locations. Also Bluetooth must be
  135. * enabled in both devices before sharing locations.
  136. *
  137. * \subsection usage_map_view_subsec Map view
  138. *
  139. * When the application is launched it queries the current location and shows that
  140. * in the center of the map view. Also a dialog is opened to store the current position.
  141. * If the current location does not have a name, it is shown as a string representation
  142. * of the coordinates in decimal degrees format.
  143. *
  144. * The "My position" button starts a new position update request, that will open
  145. * a dialog to store the location. The "Bookmarks" button opens the bookmark view.
  146. *
  147. * \subsection usage_bookmark_view_subsec Bookmark view
  148. *
  149. * Bookmark view shows the locations stored in the device. Tapping a bookmark
  150. * updates the map view to show that location.
  151. *
  152. * Tap the "Share" button to start the NFC request to connect with another device using
  153. * Bluetooth. Exchange Bluetooth information by touching the phones together. A note
  154. * "Device XXXX connected." is shown, if the connection is successfully established.
  155. * Location is then shared by tapping a bookmark. The receiving device shows a
  156. * "Location XXXX received." note on successful sharing.
  157. *
  158. * \section compatibility_sec Compatibility
  159. *
  160. * This sample application has been tested using the following hardware and
  161. * software:
  162. *
  163. * <ul>
  164. * <li>Nokia C7-00 with Symbian Anna Firmware</li>
  165. * <li>Nokia Qt SDK 1.1</li>
  166. * <li>QtMobility 1.2 Beta1</li>
  167. * </ul>
  168. *
  169. * \section change_history_sec Change history
  170. *
  171. * 1.0 First version
  172. *
  173. * \section references_sec References
  174. *
  175. * NFC: http://www.forum.nokia.com/NFC
  176. *
  177. * Qt for Symbian: http://qt.nokia.com/downloads
  178. */
  179. int main(int argc, char *argv[]);