Detecting which floor the user is currently on is done in the same way as determining the X and Y coordinates. Each access point is also assigned a Z value: 0 for the first floor, 20 for the second, and 40 for the third. On the first floor the calculated average z value will be between 0 and 10, the second floor will be between 10 and 30, and the third floor will be over 30. This works so well because the distance between the first and third floors is enough so that third floor APs are not within range of a phone on the first floor and vice versa.
To limit a decrease in performance while these calculations are begin performed, the AP location lookup and averaging is done in a separate thread from the main app. This means that these calculations will not affect the map drawing or any user interface performance.
The list of rooms to which the user can navigate is dynamically filled at the beginning of the app by downloading the list of rooms from the server at the same time that the AP locations are downloaded. When the user chooses a room to which the user wishes to navigate, iDOCENT sends a request to the server to give a list of nodes from the user's current location to the destination room. This list is then passed along to the drawing system to draw the path.