public final class Settings
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
abortedOnLastRun
Field set to true if the program have aborted on last run.
|
static java.lang.String |
activationId
READ-ONLY unique identifier available for registered applications after the TotalCross VM is activated.
Value defaults to "NOT AVAILABLE" when running on DEMO, and "NO ACTIVATION" when using the new licensing model. |
static java.lang.String |
activationKey
The activation key used during deploy
|
static java.lang.String |
activationServerNamespace
Set it at the application's static initializer.
|
static java.lang.String |
activationServerURI
Set it at the application's static initializer.
|
static boolean |
allowBackup
Apps that target Android 6.0 (API level 23) or higher automatically
participate in Auto Backup.
|
static byte |
Android
Deprecated.
Use ANDROID_UI instead
|
static java.lang.String |
ANDROID
Underlying platform is Android.
|
static java.lang.String |
ANDROID_ID
On Android it has the value of Settings.Secure.ANDROID_ID.
|
static byte |
ANDROID_UI
Defines an Android user interface style.
|
static java.lang.String |
appCategory
Deprecated.
No longer used.
|
static java.lang.String |
appDescription
Set it at the application's static initializer.
|
static java.lang.String |
applicationId
The application's ID.
|
static java.lang.String |
appLocation
Deprecated.
No longer used.
|
static java.lang.String |
appPackageIdentifier
Set it at the application's static initializer.
|
static java.lang.String |
appPackagePublisher
Set it at the application's static initializer.
|
static java.lang.String |
appPath
The path from where the application is running from.
|
static Hashtable |
appProps
Some properties you may want to use in the application.
|
static java.lang.String |
appSecretKey
Application defined secret key.
|
static java.lang.String |
appSettings
Application defined settings.
|
static byte[] |
appSettingsBin
Application defined settings, stored as a byte array.
|
static java.lang.String |
appVersion
Set it at the application's static initializer.
|
static java.lang.String |
BLACKBERRY
Dumb field to keep compilation compatibility with TC 1
|
static java.lang.String |
bugreportEmail
An email that will be used to send bug reports when an unhandled exception is caught
on your application.
|
static java.lang.String |
bugreportUser
Set this to the username of your application to be able to filter at the bug report service.
|
static int |
buildNumber
Current build number for the TotalCross SDK.
|
static int |
chunksCreated
Number of memory chunks (blocks of memory that store Objects) created.
|
static boolean |
circularNavigation
Set to false to disable the default circular navigation when using the arrows: it will stop at the first or the last item.
|
static int |
CLOSE_BUTTON
To be used in the closeButtonType.
|
static int |
closeButtonType
Set it at the application's static initializer.
|
static java.lang.String |
companyContact
Set it at the application's static initializer.
|
static java.lang.String |
companyInfo
Set it at the application's static initializer; should not contain spaces.
|
static IVirtualKeyboard |
customKeyboard |
static java.lang.String |
dataPath
Specifies the directory where pdbs should be read/written.
|
static byte |
DATE_DMY
Constant used in dateFormat: day month year
|
static byte |
DATE_MDY
Constant used in dateFormat: month day year
|
static byte |
DATE_YMD
Constant used in dateFormat: year month day
|
static byte |
dateFormat
Can be one of the following constants: DATE_MDY, DATE_DMY, DATE_YMD; where m = month, d = day and y = year
|
static char |
dateSeparator
The date char separator.
|
static boolean |
daylightSavings
Deprecated.
Use daylightSavingsMinutes
|
static int |
daylightSavingsMinutes
Daylight savings minutes to add; will be 0 when not in daylight savings.
|
static boolean |
debugEvents
Set to true to debug all events that are received at Window._postEvent.
|
static char |
decimalSeparator
The decimal separator for numbers
|
static int |
deviceFontHeight
The size in pixels of the device's system font.
|
static java.lang.String |
deviceId
Field that represents a device id that can be used to identify the device's name.
|
static int |
deviceRobotSpecialKey
Makes the generation of user interface tests much easier by using the built-in
User Interface Robot.
|
static boolean |
disableScreenRotation
Set to true to disable screen rotation.
|
static boolean |
dontCloseApplication
Deprecated.
Not used in any platform
|
static boolean |
enableVirtualKeyboard
Set to false to disable the virtual keyboard on all Edits and MultiEdits at once
|
static java.lang.String |
esn
Field that represents the smartphone ESN (if this device is a CDMA smartphone) or null if there's none.
|
static boolean |
fadeOtherWindows
Default fadeOtherWindows value used in the totalcross.ui.dialog windows.
|
static boolean |
fingerTouch
Defines platforms that the touchscreen is used MOSTLY with the finger.
|
static byte |
Flat
Deprecated.
Use FLAT_UI instead
|
static byte |
FLAT_UI
Defines a FLAT user interface style, like the ones used in Pocket PC 2003.
|
static java.lang.String |
fullScreenPlatforms
Set this to a list of platforms that will set the fullscreen mode.
|
static int |
gcCount
Number of times that the GC ran.
|
static int |
gcTime
How much time the GC took in all runs.
|
static boolean |
geographicalFocus
When directional keys are used to change focus, the next control to receive focus will be determined based on
their physical location on the screen.
|
static byte |
Holo
Deprecated.
Use HOLO_UI instead
|
static byte |
HOLO_UI
Defines an Holo user interface style.
|
static java.lang.String |
iccid
Field that represents the serial number of the GSM chip or null if there's none.
|
static java.lang.String |
imei
Field that represents the smartphone IMEI (if this device is a GSM, UMTS or IDEN smartphone), or null if there's none.
|
static java.lang.String[] |
imeis
Field that represents the smartphone IMEIs; used in phones with more than one line.
|
static Time |
iosCertDate
The due date of the iOS certificate.
|
static java.lang.String |
iosCFBundleIdentifier
Set it at the application's static initializer.
|
static java.lang.String |
IPAD
Underlying platform is iPad.
|
static java.lang.String |
IPHONE
Underlying platform is iPhone.
|
static boolean |
is24Hour
True if the time format is 24 hour format or if it is the AM/PM format
|
static boolean |
isFullScreen
Set it at the application's static initializer.
|
static boolean |
isMinimized
Dumb field to keep compilation compatibility with TC 1
|
static boolean |
isOpenGL
Returns true if this is an open gl platform (IOS or Android).
|
static java.lang.String |
JAVA
Underlying platform is Java.
|
static boolean |
keyboardFocusTraversable
Defines if the arrow keys will be used to change the focus using the keyboard.
|
static boolean |
keypadOnly
Dumb field to keep compilation compatibility with TC 1
|
static int |
lastInteractionTime
Time when the user last interacted with the device using the keyboard, pen, trackball, etc.
|
static java.lang.String |
lineNumber
Returns the line number of the device.
|
static java.lang.String |
LINUX
Underlying platform is Linux.
|
static java.lang.String |
LINUX_ARM
Underlying platform is Linux ARM.
|
static java.lang.String |
macAddress
Deprecated.
due to provide users with greater data protection
|
static byte |
Material
Defines an user interface style.
|
static byte |
MATERIAL_UI
Defines an user interface style.
|
static int |
minimalUpdateInterval
Minimal interval between two Update events
|
static int |
MINIMIZE_BUTTON
To be used in the closeButtonType.
|
static boolean |
moveCursorToEndOnFocus
Set to true to put the cursor at the end of the Edit and MultiEdit when focus was set to the control
(default is at the end).
|
static boolean |
multipleInstances
Setting this field to true allows the execution of multiple instances of the same application.
|
static int |
NO_BUTTON
To be used in the closeButtonType.
|
static int |
nvfsVolume
Dumb field to keep compilation compatibility with TC 1
|
static boolean |
onJavaSE
Field that defines if running in Java Standard Edition
(ie, in Eclipse or java in your desktop or even on an applet in a browser) instead of a handheld device.
|
static boolean |
optimizeScroll
Set to false to disable the scroll optimization using images.
|
static int |
optionalBackspaceKey
An optional value for the backspace key.
|
static byte |
PalmOS
Deprecated.
Use Flat, Vista or Android. This user interface does not work on TotalCross 2.
|
static java.lang.String |
PALMOS
Dumb field to keep compilation compatibility with TC 1
|
static java.lang.String |
platform
Field that returns the current platform name.
|
static java.lang.String |
POCKETPC
Underlying platform is Pocket PC.
|
static java.lang.String |
pushTokenAndroid
Deprecated.
|
static boolean |
resizableWindow
Set to true to make the program's window resizable in Windows and desktop.
|
static java.lang.String |
romSerialNumber
Field that represents the ROM serial number for this device.
|
static int |
romVersion
Field that returns the ROM version of the device, like 0x02000000 or 0x03010000.
|
static int |
screenBPP
Field that represents if the device supports color.
|
static double |
screenDensity
The logical density of the display, used as a scaling factor for density
independent pixels (dp) and scaleable pixels (sp).
|
static int |
screenHeight
Field that represents the device's screen height
|
static int |
screenHeightInDPI
Field that represents the device's screen vertical pixels density, in dots per inch (DPI).
|
static int |
screenWidth
Field that represents the device's screen width
|
static int |
screenWidthInDPI
Field that represents the device's screen horizontal pixels density, in dots per inch (DPI).
|
static int |
scrollDistanceOnMouseWheelMove
Set to 0 to disable the automatic scroll of the ScrollContainer under the
mouse position when the mouse wheel changes.
|
static boolean |
sendPressEventOnChange
Set to true to post a PRESSED event when an item is programatically selected or changed.
|
static boolean |
showDebugTimestamp
Set to false to don't display the timestamp before each Vm.debug output.
|
static boolean |
showDesktopMessages
Set to false to hide all messages that are sent to the console when running at the desktop.
|
static boolean |
showMemoryMessagesAtExit
Set this flag to false (default is true) to don't display the memory errors when the program exits.
|
static boolean |
showMousePosition
Shows the mouse position in the Window's title when running as Java SE application.
|
static boolean |
showSecrets
Deprecated.
This was only used in Palm OS, which is now unsupported
|
static boolean |
showUIErrors
Set to false to disable UI positional errors that are shown in Java SE
|
static int |
SIPBottomLimit
The limit that will make the Soft Input Panel be placed at bottom.
|
static char |
thousandsSeparator
The thousands separator for numbers
|
static char |
timeSeparator
The time char separator
|
static int |
timeZone
Deprecated.
Use timeZoneMinutes
|
static int |
timeZoneMinutes
Timezone in minutes.
|
static java.lang.String |
timeZoneStr
Textual description of the time zone currently used by the device.
|
static int |
touchTolerance
Defines a touch tolerance to find the closest control.
|
static boolean |
uiAdjustmentsBasedOnFontHeight
Set to true to make the extra adjustment values used in the relative positioning be a percentage
of the control's font height.
|
static byte |
uiStyle
Field that stores the current user interface style.
|
static boolean |
unmovableSIP
Set to true to move an Edit or MultiEdit to the top of the screen
if the application is running in a platform
that does not support moving the Soft Input Panel to the top.
|
static boolean |
useNewFont
Dumb field to keep compilation compatibility with TC 1
|
static java.lang.String |
userName
Field that returns the username of the user running the Virtual Machine.
|
static int |
version
Field that represents the version of the TotalCross Virtual Machine.
|
static java.lang.String |
versionStr
Field that represents the version in a string form, like "1.36".
|
static boolean |
vibrateMessageBox
Set to true to enable the vibration when a MessageBox appears on screen (only on device).
|
static boolean |
virtualKeyboard
True if this handheld has a virtual keyboard, I.E., like the soft input panel in windows ce devices or in the Tungsten T|X.
|
static byte |
Vista
Deprecated.
Use VISTA_UI instead
|
static byte |
VISTA_UI
Defines a Windows Vista user interface style.
|
static java.lang.String |
vmPath
The main path used to derive
tempPath and appPath and also
to store TotalCross global files. |
static byte |
weekStart
The week day start.
|
static java.lang.String |
WIN32
Underlying platform is desktop Windows.
|
static byte |
WinCE
Deprecated.
Use Flat, Vista or Android. This user interface does not work on TotalCross 2.
|
static int |
windowFont
Deprecated.
Use at the application's constructor: if (Settings.platform.equals(Settings.WIN32)) setDefaultFont(Font.getFont(false,NN)); where NN is the desired font size
|
static int |
WINDOWFONT_12
Used in the windowFont field; sets the size to 12.
|
static int |
WINDOWFONT_DEFAULT
Used in the windowFont field; sets the size to the one defined by user.
|
static java.lang.String |
WINDOWSCE
Underlying platform is Windows CE.
|
static int |
windowSize
Defines the window size when running in a desktop computer (the default is 240x320).
|
static int |
WINDOWSIZE_320X480
Used in the windowSize field.
|
static int |
WINDOWSIZE_480X640
Used in the windowSize field.
|
static int |
WINDOWSIZE_600X800
Used in the windowSize field.
|
static java.lang.String |
WINDOWSMOBILE
Underlying platform is Windows Mobile.
|
static java.lang.String |
WINDOWSPHONE
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
appBuildNumber()
Returns the application's build number.
|
static int |
getAnimationMaximumFps() |
static boolean |
isIOS()
Returns true if this is an iPad or an iPhone.
|
static boolean |
isLandscape()
Returns true if the device is currently in landscale (screenWidth > screenHeight).
|
static boolean |
isWindowsCE()
Returns true if the current platform is Windows Mobile or Windows Phone.
|
static boolean |
isWindowsDevice()
Returns true if the current platform is Windows Mobile or Windows Phone.
|
static void |
refresh()
Refresh some fields thay may have been updated since the program
started.
|
public static int version
public static java.lang.String versionStr
public static int buildNumber
public static Hashtable appProps
property=value<enter>This file must be named
tcapp.prop
and it is searched from the current folder up to the root folder.
To have a build number be incremented by tc.Deploy, just create the file somewhere in a parent folder from
where you run tc.Deploy for your application.
The file will be inserted into the application's tcz and you will be able to retrieve the build number using
Settings.appBuildNumber()
.
Note that the properties are always read-only and you can add other values to be used in your application.public static byte dateFormat
public static char dateSeparator
public static byte weekStart
public static boolean is24Hour
public static char timeSeparator
public static char thousandsSeparator
public static char decimalSeparator
public static int screenWidth
public static int screenHeight
public static int screenWidthInDPI
public static int screenHeightInDPI
public static int screenBPP
public static boolean onJavaSE
public static int romVersion
public static final java.lang.String JAVA
platform
member.public static final java.lang.String WINDOWSCE
platform
member.public static final java.lang.String POCKETPC
platform
member.public static final java.lang.String WINDOWSMOBILE
platform
member.public static final java.lang.String WIN32
platform
member.@Deprecated public static final java.lang.String WINDOWSPHONE
platform
member.public static final java.lang.String LINUX
platform
member.public static final java.lang.String IPHONE
platform
member.public static final java.lang.String ANDROID
platform
member.public static final java.lang.String IPAD
platform
member.public static final java.lang.String LINUX_ARM
platform
member.public static java.lang.String platform
public static java.lang.String userName
public static byte[] appSettingsBin
if (Settings.appSettingsBin == null) { add(new Label("empty"),CENTER,CENTER); ByteArrayStream bas = new ByteArrayStream(100); DataStream ds = new DataStream(bas); ds.writeDouble(1234.567); Settings.appSettingsBin = bas.getCopy(); } else { ByteArrayStream bas = new ByteArrayStream(Settings.appSettingsBin); DataStream ds = new DataStream(bas); double d = ds.readDouble(); add(new Label("d = "+Convert.toString(d,3)),CENTER,CENTER); Settings.appSettingsBin = null; }This property is saved only at application's exit; you can force an update by calling
Settings.refresh()
.refresh()
public static java.lang.String appSettings
Settings.refresh()
.refresh()
public static java.lang.String appSecretKey
In Windows CE, the key is stored in the registry.
This property is saved only at application's exit; you can force an update by calling Settings.refresh()
.
refresh()
public static java.lang.String applicationId
@Deprecated public static final byte WinCE
MainWindow.setUIStyle(byte)
,
Constant Field Values@Deprecated public static final byte PalmOS
MainWindow.setUIStyle(byte)
,
Constant Field Values@Deprecated public static final byte Flat
MainWindow.setUIStyle(byte)
,
Constant Field Values@Deprecated public static final byte Vista
MainWindow.setUIStyle(byte)
,
Constant Field Values@Deprecated public static final byte Android
MainWindow.setUIStyle(byte)
,
Constant Field Values@Deprecated public static final byte Holo
MainWindow.setUIStyle(byte)
,
Constant Field Valuespublic static final byte Material
MainWindow.setUIStyle(byte)
,
Constant Field Valuespublic static final byte FLAT_UI
MainWindow.setUIStyle(byte)
,
Constant Field Valuespublic static final byte VISTA_UI
MainWindow.setUIStyle(byte)
,
Constant Field Valuespublic static final byte ANDROID_UI
MainWindow.setUIStyle(byte)
,
Constant Field Valuespublic static final byte HOLO_UI
MainWindow.setUIStyle(byte)
,
Constant Field Valuespublic static final byte MATERIAL_UI
MainWindow.setUIStyle(byte)
,
Constant Field Valuespublic static byte uiStyle
FLAT_UI
,
VISTA_UI
,
ANDROID_UI
,
HOLO_UI
,
MATERIAL_UI
public static final byte DATE_MDY
public static final byte DATE_DMY
public static final byte DATE_YMD
@Deprecated public static boolean daylightSavings
public static int daylightSavingsMinutes
int dif = Settings.timeZoneMinutes + Settings.daylightSavingsMinutes; int hours = dif / 60; int minutes = Math.abs(dif % 60);
@Deprecated public static int timeZone
public static int timeZoneMinutes
int dif = Settings.timeZoneMinutes + Settings.daylightSavingsMinutes; int hours = dif / 60; int minutes = Math.abs(dif % 60);
public static boolean virtualKeyboard
public static java.lang.String dataPath
/dataPath
commandline parameter.
null
(unless the library is also in the dataPath).
public static java.lang.String romSerialNumber
null
if unavailable, such as in
Windows CE 2.11 devices, Palm OS < 3.0, and even some Palm OS 5 devices,
like Treo 6xx.
Note: this was correctly tested; you can ensure that your Palm OS device has or not a serial number pressing App/Info/Version: the serial number will appear in the top; if nothing appears, it means that the device doesn't has a serial number. If it appears but nothing is returned from here, it means that the device has a non-standard function that retrieves the serial number, and thus we don't support it. In Android 3.0 or greater it will return the serial number; in Android 1.x and 2.x will return a consistent number that MAY be the same across resets, but has no relation to the real serial number.
@Deprecated public static java.lang.String macAddress
@Deprecated public static boolean showSecrets
public static boolean keyboardFocusTraversable
public static java.lang.String deviceId
null
.public static java.lang.String vmPath
tempPath
and appPath
and also
to store TotalCross global files. This is a read-only property: changing it will have
no effect.public static java.lang.String appPath
dataPath
public static final int NO_BUTTON
public static final int CLOSE_BUTTON
public static final int MINIMIZE_BUTTON
public static int closeButtonType
CLOSE_BUTTON
,
MINIMIZE_BUTTON
,
NO_BUTTON
public static boolean isFullScreen
fullScreenPlatforms
public static java.lang.String fullScreenPlatforms
static { Settings.isFullScreen = true; Settings.fullScreenPlatforms = Settings.WINDOWSCE+","+Settings.WINDOWSMOBILE; }You can use any separator. The only platform that does not work with this is JAVA. You must provide a String like the one above, concatenating the platform Strings in a single line. Using a StringBuffer or anything else may result in incorrect results.
isFullScreen
public static java.lang.String appVersion
Settings.appVersion += Settings.appBuildNumber();
public static java.lang.String companyInfo
public static java.lang.String companyContact
public static java.lang.String appDescription
public static java.lang.String appPackageIdentifier
public static java.lang.String appPackagePublisher
public static java.lang.String iosCFBundleIdentifier
@Deprecated public static java.lang.String appLocation
@Deprecated public static java.lang.String appCategory
public static java.lang.String activationServerURI
public static java.lang.String activationServerNamespace
public static boolean showDesktopMessages
public static java.lang.String imei
public static java.lang.String[] imeis
public static java.lang.String esn
public static java.lang.String iccid
@Deprecated public static boolean dontCloseApplication
MainWindow.exit(int)
public static boolean geographicalFocus
public static boolean multipleInstances
public static boolean circularNavigation
public static int gcCount
public static int gcTime
public static int chunksCreated
public static int lastInteractionTime
public static boolean showMemoryMessagesAtExit
public static boolean showMousePosition
public static int deviceRobotSpecialKey
Vm.interceptSpecialKeys(new int[]{SpecialKeys.FIND}); Settings.deviceRobotSpecialKey = SpecialKeys.FIND;
public static boolean showDebugTimestamp
public static java.lang.String timeZoneStr
public static boolean fingerTouch
public static int touchTolerance
public static boolean fadeOtherWindows
public static boolean debugEvents
public static java.lang.String activationId
public static boolean vibrateMessageBox
public static boolean disableScreenRotation
public void screenResized() { if (Settings.isLandscape()) { // make sure that the MessageBox takes the whole screen MessageBox mb = new MessageBox("Attention","This program must be run in portrait mode.\nPlease rotate the device.",null) { public void setRect(int x, int y, int w, int h) { super.setRect(x,y,Settings.screenWidth,Settings.screenHeight); } }; mb.transitionEffect = TRANSITION_NONE; mb.popupNonBlocking(); while (Settings.isLandscape()) pumpEvents(); mb.unpop(); } else super.screenResized(); }
public static boolean unmovableSIP
SIPBottomLimit
,
UIColors.shiftScreenColor
public static int deviceFontHeight
public static boolean moveCursorToEndOnFocus
public static int SIPBottomLimit
Settings.SIPBottomLimit = 5 * fmH;Setting it to -1 (default value) will use half the current screen height. This field is used in Windows CE devices only.
public static boolean uiAdjustmentsBasedOnFontHeight
public static boolean sendPressEventOnChange
public static boolean resizableWindow
public static final int WINDOWSIZE_320X480
public static final int WINDOWSIZE_480X640
public static final int WINDOWSIZE_600X800
public static int windowSize
WINDOWSIZE_320X480
,
WINDOWSIZE_480X640
,
WINDOWSIZE_600X800
,
resizableWindow
public static final int WINDOWFONT_12
public static final int WINDOWFONT_DEFAULT
@Deprecated public static int windowFont
WINDOWFONT_12
,
WINDOWFONT_DEFAULT
,
windowSize
,
resizableWindow
public static java.lang.String lineNumber
public static boolean isOpenGL
public static int optionalBackspaceKey
public static boolean optimizeScroll
public static java.lang.String PALMOS
public static java.lang.String BLACKBERRY
public static int nvfsVolume
public static boolean useNewFont
public static boolean isMinimized
public static boolean keypadOnly
public static int scrollDistanceOnMouseWheelMove
public static java.lang.String bugreportEmail
static { Settings.bugreportEmail = "[email protected]"; ... }Currently this is supported only on Android.
public static java.lang.String bugreportUser
public static java.lang.String activationKey
@Deprecated public static java.lang.String pushTokenAndroid
public static Time iosCertDate
public static boolean abortedOnLastRun
public static IVirtualKeyboard customKeyboard
public static boolean enableVirtualKeyboard
public static boolean showUIErrors
public static final java.lang.String ANDROID_ID
public static double screenDensity
public static final int minimalUpdateInterval
public static boolean allowBackup
public static java.lang.String appBuildNumber()
static { Settings.appVersion = "2.1."; // leading dot } // then at the application's constructor: Settings.appVersion += Settings.appBuildNumber();This way, when you run tc.Deploy, it will update the appVersion to include the build number in all platforms.
appProps
public static boolean isWindowsDevice()
public static boolean isWindowsCE()
public static boolean isIOS()
public static void refresh()
public static boolean isLandscape()
public static int getAnimationMaximumFps()