init : function() { Ti.API.debug("APP.init"); // Global system Events Ti.Network.addEventListener("change", APP.networkObserver); Ti.Gesture.addEventListener("orientationchange", APP.orientationObserver); Ti.App.addEventListener("pause", APP.exitObserver); Ti.App.addEventListener("close", APP.exitObserver); Ti.App.addEventListener("resumed", APP.resumeObserver); if (OS_ANDROID) { APP.MainWindow.addEventListener("androidback", APP.backButtonObserver); } // Determine device characteristics APP.determineDevice(); // Migrate to newer app version require("migrate").init(); // Create a database APP.setupDatabase(); // Reads in the JSON config file APP.loadContent(); // Builds out the tab group APP.build(); // Open the main window APP.MainWindow.open(); // The initial screen to show APP.handleNavigation(0); // Shows the passlock screen if activated if (USER_SETTINGS.isPasswordAssigned()) { APP.openPasslock(); } // NOTICE // The following sections are abstracted for PEEK // Updates the app from a remote source // APP.update(); // Set up ACS // APP.initACS(); // Set up push notifications APP.initPush(); // Set up OpenCard utilities APP.initOpenCard(); },
resumeObserver : function(_event) { Ti.API.debug("APP.resumeObserver"); if (USER_SETTINGS.isPasswordAssigned()) { APP.openPasslock(); } },