Difference between revisions of "Application"
(typo in code) |
(added permissions methods) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | |||
<!-- GIDEROSOBJ:Application --> | <!-- GIDEROSOBJ:Application --> | ||
− | ''' | + | '''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> |
− | ''' | + | '''Available since:''' Gideros 2011.6<br/> |
− | ''' | + | '''Inherits from:''' [[Object|Object]]<br/> |
− | === | + | === Description === |
The Application class contains the common functions that are available to the current application. There is a global variable ''application'' of type Application to access these functions. | The Application class contains the common functions that are available to the current application. There is a global variable ''application'' of type Application to access these functions. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === | + | === Methods === |
− | [[ | + | [[Application:canOpenUrl]] ''tests if it is possible to open provided url''<br/><!--GIDEROSMTD:Application:canOpenUrl(url) tests if it is possible to open provided url --> |
− | <!-- GIDEROSMTD:Application:canOpenUrl(url) | + | [[Application:checkPermission]] ''checks android permission''<br/><!--GIDEROSMTD:Application:checkPermission(permission) checks android permission--> |
− | [[ | + | [[Application:configureFrustum]] ''configures the projection for 3D perspective''<br/><!--GIDEROSMTD:Application:configureFrustum(fov,farplane) configures the projection for 3D perspective--> |
− | <!-- GIDEROSMTD:Application:configureFrustum(fov,farplane) | + | [[Application:exit]] ''terminates the application''<br/><!--GIDEROSMTD:Application:exit() terminates the application--> |
− | [[ | + | [[Application:get]] ''returns state of desktop setting''<br/><!--GIDEROSMTD:Application:get(setting) returns state of desktop setting--> |
− | <!-- GIDEROSMTD:Application:exit() terminates the application --> | + | [[Application:getApiVersion]] ''returns the API version''<br/><!--GIDEROSMTD:Application:getApiVersion() returns the API version--> |
− | [[ | + | [[Application:getAppId]] ''returns the app id or bundle id''<br/><!--GIDEROSMTD:Application:getAppId() returns the app id or bundle id--> |
− | <!-- GIDEROSMTD:Application:get(setting) returns state of desktop setting --> | + | [[Application:getBackgroundColor]] ''returns the background color''<br/><!--GIDEROSMTD:Application:getBackgroundColor() returns the background color in hexadecimal format--> |
− | [[ | + | [[Application:getContentHeight]] ''returns content height''<br/><!--GIDEROSMTD:Application:getContentHeight() returns content height--> |
− | <!-- GIDEROSMTD:Application:getApiVersion() returns the API version --> | + | [[Application:getContentWidth]] ''returns content width''<br/><!--GIDEROSMTD:Application:getContentWidth() returns content width--> |
− | [[ | + | [[Application:getDeviceHeight]] ''returns the physical height of the device''<br/><!--GIDEROSMTD:Application:getDeviceHeight() returns the physical height of the device in pixels--> |
− | <!-- GIDEROSMTD:Application:getAppId() returns the app id or bundle id --> | + | [[Application:getDeviceWidth]] ''returns the physical width of the device''<br/><!--GIDEROSMTD:Application:getDeviceWidth() returns the physical width of the device in pixels--> |
− | [[ | + | [[Application:getDeviceInfo]] ''returns information about device''<br/><!--GIDEROSMTD:Application:getDeviceInfo() returns information about device--> |
− | <!-- GIDEROSMTD:Application:getBackgroundColor() returns the background color in hexadecimal format --> | + | [[Application:getDeviceOrientation]] ''gets the device orientation''<br/><!--GIDEROSMTD:Application:getDeviceOrientation() gets the device orientation--> |
− | [[ | + | [[Application:getDeviceSafeArea]] ''returns the safe display area bounds''<br/><!--GIDEROSMTD:Application:getDeviceSafeArea(logical) returns the safe display area bounds--> |
− | <!-- GIDEROSMTD:Application:getContentHeight() returns content height --> | + | [[Application:getFps]] ''returns the frame rate of the application''<br/><!--GIDEROSMTD:Application:getFps() returns the frame rate of the application--> |
− | [[ | + | [[Application:getKeyboardModifiers]] ''returns the current keyboard modifiers''<br/><!--GIDEROSMTD:Application:getKeyboardModifiers() returns the current keyboard modifiers--> |
− | <!-- GIDEROSMTD:Application:getContentWidth() returns content width --> | + | [[Application:getLanguage]] ''returns the user language''<br/><!--GIDEROSMTD:Application:getLanguage() returns the user language--> |
− | [[ | + | [[Application:getLocale]] ''returns the device locale''<br/><!--GIDEROSMTD:Application:getLocale() returns the device locale--> |
− | <!-- GIDEROSMTD:Application:getDeviceHeight() returns the physical height of the device in pixels --> | + | [[Application:getLogicalBounds]] ''returns the physical screen bounds in logical space''<br/><!--GIDEROSMTD:Application:getLogicalBounds() returns the physical screen bounds in logical space--> |
− | [[ | + | [[Application:getLogicalHeight]] ''returns the logical height of the application''<br/><!--GIDEROSMTD:Application:getLogicalHeight() returns the logical height of the application--> |
− | <!-- GIDEROSMTD:Application:getDeviceWidth() returns the physical width of the device in pixels --> | + | [[Application:getLogicalWidth]] ''returns the logical width of the application''<br/><!--GIDEROSMTD:Application:getLogicalWidth() returns the logical width of the application --> |
− | [[ | + | [[Application:getLogicalScaleX]] ''returns the scaling of automatic screen scaling on the x-axis''<br/><!--GIDEROSMTD:Application:getLogicalScaleX() returns the scaling of automatic screen scaling on the x-axis--> |
− | <!-- GIDEROSMTD:Application:getDeviceInfo() returns information about device --> | + | [[Application:getLogicalScaleY]] ''returns the scaling of automatic screen scaling on the y-axis''<br/><!--GIDEROSMTD:Application:getLogicalScaleY() returns the scaling of automatic screen scaling on the y-axis--> |
− | [[ | + | [[Application:getLogicalTranslateX]] ''returns the translation of automatic screen scaling on the x-axis''<br/><!--GIDEROSMTD:Application:getLogicalTranslateX() returns the translation of automatic screen scaling on the x-axis--> |
− | <!-- GIDEROSMTD:Application:getDeviceOrientation() | + | [[Application:getLogicalTranslateY]] ''returns the translation of automatic screen scaling on the y-axis''<br/><!--GIDEROSMTD:Application:getLogicalTranslateY() returns the translation of automatic screen scaling on the y-axis--> |
− | [[ | + | [[Application:getOrientation]] ''returns the orientation of the application''<br/><!--GIDEROSMTD:Application:getOrientation() returns the orientation of the application--> |
− | <!-- GIDEROSMTD:Application:getDeviceSafeArea(logical) returns the safe display area bounds --> | + | [[Application:getScaleMode]] ''returns the automatic scale mode of the application''<br/><!--GIDEROSMTD:Application:getScaleMode() returns the automatic scale mode of the application--> |
− | [[ | + | [[Application:getScreenDensity]] ''returns the screen density in pixels per inch''<br/><!--GIDEROSMTD:Application:getScreenDensity() returns the screen density in pixels per inch--> |
− | <!-- GIDEROSMTD:Application:getFps() returns the frame rate of the application --> | + | [[Application:getTextureMemoryUsage]] ''returns the texture memory usage in Kbytes''<br/><!--GIDEROSMTD:Application:getTextureMemoryUsage() returns the texture memory usage in Kbytes--> |
− | [[ | + | [[Application:isPlayerMode]] ''checks if app runs on player''<br/><!--GIDEROSMTD:Application:isPlayerMode() checks if app runs on player--> |
− | <!-- GIDEROSMTD:Application:getKeyboardModifiers() returns the current keyboard modifiers --> | + | [[Application:openUrl]] ''opens the given URL in the appropriate application''<br/><!--GIDEROSMTD:Application:openUrl(url) opens the given URL in the appropriate application--> |
− | [[ | + | [[Application:requestPermissions]] ''requests an android permission''<br/><!--GIDEROSMTD:Application:requestPermissions({permissions}) requests one or more android permission(s)--> |
− | <!-- GIDEROSMTD:Application:getLanguage() returns the user language --> | + | [[Application:set]] ''sets state of desktop settings''<br/><!--GIDEROSMTD:Application:set(setting, values) sets state of desktop settings--> |
− | [[ | + | [[Application:setBackgroundColor]] ''sets the background color''<br/><!--GIDEROSMTD:Application:setBackgroundColor(color) sets the background color in hexadecimal format--> |
− | <!-- GIDEROSMTD:Application:getLocale() returns the device locale --> | + | [[Application:setFps]] ''sets the frame rate of the application''<br/><!--GIDEROSMTD:Application:setFps(fps) sets the frame rate of the application--> |
− | [[ | + | [[Application:setFullScreen]] ''full screen or window mode''<br/><!--GIDEROSMTD:Application:setFullScreen(fullscreen) full screen or window mode--> |
− | <!-- GIDEROSMTD:Application:getLogicalBounds() returns the physical screen bounds in logical space --> | + | [[Application:setKeepAwake]] ''enables/disables screen dimming and device sleeping''<br/><!--GIDEROSMTD:Application:setKeepAwake(keepAwake) enables/disables screen dimming and device sleeping--> |
− | [[ | + | [[Application:setKeyboardVisibility]] ''sets the keyboard visibility''<br/><!--GIDEROSMTD:Application:setKeyboardVisibility(visible) sets the keyboard visibility--> |
− | <!-- GIDEROSMTD:Application:getLogicalHeight() returns the logical height of the application --> | + | [[Application:setLogicalDimensions]] ''sets the logical dimensions of the application''<br/><!--GIDEROSMTD:Application:setLogicalDimensions(width,height) sets the logical dimensions of the application--> |
− | [[ | + | [[Application:setOrientation]] ''sets the orientation of the application''<br/><!--GIDEROSMTD:Application:setOrientation(orientation) sets the orientation of the application--> |
− | <!-- GIDEROSMTD:Application:getLogicalWidth() returns the logical width of the application --> | + | [[Application:setScaleMode]] ''sets the automatic scale mode of the application''<br/><!--GIDEROSMTD:Application:setScaleMode(scaleMode) sets the automatic scale mode of the application--> |
− | [[ | + | [[Application:setWindowSize]] ''sets desktop window to a specific size''<br/><!--GIDEROSMTD:Application:setWindowSize(width,height) sets desktop window to a specific size--> |
− | <!-- GIDEROSMTD:Application:getLogicalScaleX() returns the scaling of automatic screen scaling on the x-axis --> | + | [[Application:vibrate]] ''vibrates the device''<br/><!--GIDEROSMTD:Application:vibrate(ms) vibrates the device--> |
− | [[ | ||
− | <!-- GIDEROSMTD:Application:getLogicalScaleY() returns the scaling of automatic screen scaling on the y-axis --> | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application:getLogicalTranslateX() returns the translation of automatic screen scaling on the x-axis --> | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application:getLogicalTranslateY() returns the translation of automatic screen scaling on the y-axis --> | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application:getOrientation() returns the orientation of the application --> | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application:getScaleMode() returns the automatic scale mode of the application --> | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application:getScreenDensity() returns the screen density in pixels per inch --> | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application:getTextureMemoryUsage() returns the texture memory usage in Kbytes --> | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application:isPlayerMode() | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application:openUrl(url) opens the given URL in the appropriate application --> | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:Application: | ||
− | [[ | ||
− | |||
− | [[ | ||
− | <!-- GIDEROSMTD:Application:vibrate(ms) vibrates the device --> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === | + | === Events === |
− | [[ | + | [[Event.APPLICATION_START|Event.APPLICATION_START]]<br/> |
− | [[ | + | [[Event.APPLICATION_RESIZE|Event.APPLICATION_RESIZE]]<br/> |
− | [[ | + | [[Event.APPLICATION_SUSPEND|Event.APPLICATION_SUSPEND]]<br/> |
− | [[ | + | [[Event.APPLICATION_EXIT|Event.APPLICATION_EXIT]]<br/> |
− | [[ | + | [[Event.APPLICATION_RESUME|Event.APPLICATION_RESUME]]<br/> |
− | === | + | === Constants === |
− | [[ | + | [[Application.LANDSCAPE_LEFT|Application.LANDSCAPE_LEFT]]<br/><!-- GIDEROSCST:Application.LANDSCAPE_LEFT landscapeLeft--> |
− | <!-- GIDEROSCST:Application.LANDSCAPE_LEFT landscapeLeft--> | + | [[Application.LANDSCAPE_RIGHT|Application.LANDSCAPE_RIGHT]]<br/><!-- GIDEROSCST:Application.LANDSCAPE_RIGHT landscapeRight--> |
− | [[ | + | [[Application.PORTRAIT|Application.PORTRAIT]]<br/><!-- GIDEROSCST:Application.PORTRAIT portrait--> |
− | <!-- GIDEROSCST:Application.LANDSCAPE_RIGHT landscapeRight--> | + | [[Application.PORTRAIT_UPSIDE_DOWN|Application.PORTRAIT_UPSIDE_DOWN]]<br/><!-- GIDEROSCST:Application.PORTRAIT_UPSIDE_DOWN portraitUpsideDown--> |
− | [[ | ||
− | <!-- GIDEROSCST:Application.PORTRAIT portrait--> | ||
− | [[ | ||
− | <!-- GIDEROSCST:Application.PORTRAIT_UPSIDE_DOWN portraitUpsideDown--> | ||
|} | |} | ||
{{GIDEROS IMPORTANT LINKS}} | {{GIDEROS IMPORTANT LINKS}} |
Revision as of 01:53, 5 December 2020
Supported platforms:
Available since: Gideros 2011.6
Inherits from: Object
Description
The Application class contains the common functions that are available to the current application. There is a global variable application of type Application to access these functions.
MethodsApplication:canOpenUrl tests if it is possible to open provided url |
EventsEvent.APPLICATION_START ConstantsApplication.LANDSCAPE_LEFT |