Moai SDK  1.5 revision 1 (MoaiEdition)
MOAIEnvironment Class Reference

Inherits MOAIGlobalClass< TYPE, SUPER >.

List of all members.

Function List

  generateGUID
  getMACAddress
  setValue

Detailed Description

Table of key/value pairs containing information about the current environment. Also contains the generateGUID (), which will move to MOAIUnique in a future release.

If a given key is not supported in the current environment it will not exist (it's value will be nil).

The keys are:

  • appDisplayName
  • appID
  • appVersion
  • cacheDirectory
  • carrierISOCountryCode
  • carrierMobileCountryCode
  • carrierMobileNetworkCode
  • carrierName
  • connectionType
  • countryCode
  • cpuabi
  • devBrand
  • devName
  • devManufacturer
  • devModel
  • devPlatform
  • devProduct
  • documentDirectory
  • iosRetinaDisplay
  • languageCode
  • numProcessors
  • osBrand
  • osVersion
  • resourceDirectory
  • screenDpi
  • verticalResolution
  • horizontalResolution
  • udid
  • openUdid
Constants Description
MOAIEnvironment.CONNECTION_TYPE_NONE Signifies that there is no active connection
MOAIEnvironment.CONNECTION_TYPE_WIFI Signifies that the current connection is via WiFi
MOAIEnvironment.CONNECTION_TYPE_WWAN Signifies that the current connection is via WWAN
MOAIEnvironment.OS_BRAND_ANDROID Signifies that Moai is currently running on Android
MOAIEnvironment.OS_BRAND_IOS Signifies that Moai is currently running on iOS
MOAIEnvironment.OS_BRAND_OSX Signifies that Moai is currently running on OSX
MOAIEnvironment.OS_BRAND_LINUX Signifies that Moai is currently running on Linux
MOAIEnvironment.OS_BRAND_WINDOWS Signifies that Moai is currently running on Windows
MOAIEnvironment.OS_BRAND_UNAVAILABLE Signifies that the operating system cannot be determined

Function Documentation

Generates a globally unique identifier. This method will be moved to MOAIUnique in a future release.


function generateGUID ()
Returns:
GUID ( string )

Finds and returns the primary MAC Address.


function getMACAddress ()
Returns:
MAC ( string )

Sets an environment value and also triggers the listener callback (if any).


function setValue ( string key [, variant value ] )
Parameters:
key ( string )
value ( variant ) Optional. Default value is nil.
Returns:
nil