Mobile SDK > Connected mobile application example reference > Components overview > main.js
 
main.js
Public methods
initialize
Registers the Stop, Back, and Next click event, initializes the page manager object and sets the user interface's initial state.
Major private properties
_context
Type: Object
The object always exists in the running application, and provides the shared information that is used in other components. The following shared information is provided:
host: The server to which the application connects.
project: The survey project.
url: The Webservice URL.
sessionToken: The session token that is posted in the header field.page: Page data.
Major private methods
_start
GET the /api/surveys/PROJECT URL to start the survey. The method creates a new interview and returns the first data page. The response includes the session token, which is passed in the headers property of the POST operation.
_accessServer
GET page data from the server and POST response data to the server.
_navigate
Controls the Stop, Next, and Back functions.
See also
Components overview