Skip to content

Latest commit

 

History

History
 
 

application

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
nav-title title description
Module application
Module application
Module application

Module: "application"

// To import the "application" module:
var application = require("application");
Object Description
NativeScriptError An extended JavaScript Error which will have the nativeError property initialized in case the error is caused by executing platform-specific code.
AndroidApplication The abstraction of an Android-specific application object.
iOSApplication The abstraction of an iOS-specific application object.
Variables
  • mainModule - String.
    The main page path (without the file extension) for the application starting from the application root. For example if you have page called "main.js" in a folder called "subFolder" and your root folder is "app" you can specify mainModule like this: var application = require("application"); application.mainModule = "app/subFolder/main"; application.start();
  • cssFile - String.
    The application level css file name (starting from the application root). Used to set css across all pages. Css will be applied for every page and page css will be applied after.
  • cssSelectorsCache - Array of Object.
    Cached css selectors created from the content of the css file.
  • android - AndroidApplication.
    This is the Android-specific application object instance. Encapsulates methods and properties specific to the Android platform. Will be undefined when TargetOS is iOS.
  • ios - iOSApplication.
    This is the iOS-specific application object instance. Encapsulates methods and properties specific to the iOS platform. Will be undefined when TargetOS is Android.
Functions
  • loadCss()
    Loads css file and parses to a css syntax tree.
  • start()
    Call this method to start the application. Important: All code after this method call will not be executed!
  • onLaunch( context Object )
    The main entry point event. This method is expected to use the root frame to navigate to the main application page.
    • context - Object
  • onUncaughtError( error NativeScriptError )
    A callback to be used when an uncaught error occurs while the application is running. The application will be shut down after this method returns. Loading new UI at this point is erroneous and may lead to unpredictable results. The method is intended to be used for crash reports and/or application restart.
  • onSuspend()
    This method will be called when the Application is suspended.
  • onResume()
    This method will be called when the Application is resumed after it has been suspended.
  • onExit()
    This method will be called when the Application is about to exit.
  • onLowMemory()
    This method will be called when there is low memory on the target device.