Android Programming Press on the image to return to the main documentation page.

Constants (Core)

List of types:

Colors
DialogResponse
Gravity
KeyCodes
Typeface

Colors

A predefined object containing color constants.
For example: Activity.Color = Colors.Green

Events:

None

Members:


  ARGB (Alpha As Int, R As Int, G As Int, B As Int) As Int

  Black As Int

  Blue As Int

  Cyan As Int

  DarkGray As Int

  Gray As Int

  Green As Int

  LightGray As Int

  Magenta As Int

  Red As Int

  RGB (R As Int, G As Int, B As Int) As Int

  Transparent As Int

  White As Int

  Yellow As Int

Members description:

ARGB (Alpha As Int, R As Int, G As Int, B As Int) As Int
Returns an integer value representing the color built from the three components and with the specified alpha value.
Each component should be a value between 0 to 255 (inclusive)
Alpha - A value between 0 to 255 where 0 is fully transparent and 255 is fully opaque.
Black As Int
Blue As Int
Cyan As Int
DarkGray As Int
Gray As Int
Green As Int
LightGray As Int
Magenta As Int
Red As Int
RGB (R As Int, G As Int, B As Int) As Int
Returns an integer value representing the color built from the three components.
Each component should be a value between 0 to 255 (inclusive)
Alpha is implicitly set to 255 (opaque).
Transparent As Int
White As Int
Yellow As Int

DialogResponse

A predefined object containing the possible values that dialogs return.
For example:
Dim result As Int
result = Msgbox2("Save changes?", "", "Yes", "", "No", Null)
If result = DialogResponse.POSITIVE Then
  'save changes
End If

Events:

None

Members:


  CANCEL As Int

  NEGATIVE As Int

  POSITIVE As Int

Members description:

CANCEL As Int
NEGATIVE As Int
POSITIVE As Int

Gravity

Predefined object containing "gravity" values.
These values affect the alignment of text or images.
Example:
Dim EditText1 As EditText
EditText1.Initialize("")
EditText1.Gravity = Gravity.CENTER

Events:

None

Members:


  BOTTOM As Int

  CENTER As Int

  CENTER_HORIZONTAL As Int

  CENTER_VERTICAL As Int

  FILL As Int

  LEFT As Int

  NO_GRAVITY As Int

  RIGHT As Int

  TOP As Int

Members description:

BOTTOM As Int
CENTER As Int
CENTER_HORIZONTAL As Int
CENTER_VERTICAL As Int
FILL As Int
LEFT As Int
NO_GRAVITY As Int
RIGHT As Int
TOP As Int

KeyCodes

A predefined object with the key codes constants. These constants are passed to Activity KeyPressed event for example.

Events:

None

Members:


  KEYCODE_0 As Int

  KEYCODE_1 As Int

  KEYCODE_2 As Int

  KEYCODE_3 As Int

  KEYCODE_4 As Int

  KEYCODE_5 As Int

  KEYCODE_6 As Int

  KEYCODE_7 As Int

  KEYCODE_8 As Int

  KEYCODE_9 As Int

  KEYCODE_A As Int

  KEYCODE_ALT_LEFT As Int

  KEYCODE_ALT_RIGHT As Int

  KEYCODE_APOSTROPHE As Int

  KEYCODE_AT As Int

  KEYCODE_B As Int

  KEYCODE_BACK As Int

  KEYCODE_BACKSLASH As Int

  KEYCODE_C As Int

  KEYCODE_CALL As Int

  KEYCODE_CAMERA As Int

  KEYCODE_CLEAR As Int

  KEYCODE_COMMA As Int

  KEYCODE_D As Int

  KEYCODE_DEL As Int

  KEYCODE_DPAD_CENTER As Int

  KEYCODE_DPAD_DOWN As Int

  KEYCODE_DPAD_LEFT As Int

  KEYCODE_DPAD_RIGHT As Int

  KEYCODE_DPAD_UP As Int

  KEYCODE_E As Int

  KEYCODE_ENDCALL As Int

  KEYCODE_ENTER As Int

  KEYCODE_ENVELOPE As Int

  KEYCODE_EQUALS As Int

  KEYCODE_EXPLORER As Int

  KEYCODE_F As Int

  KEYCODE_FOCUS As Int

  KEYCODE_G As Int

  KEYCODE_GRAVE As Int

  KEYCODE_H As Int

  KEYCODE_HEADSETHOOK As Int

  KEYCODE_HOME As Int

  KEYCODE_I As Int

  KEYCODE_J As Int

  KEYCODE_K As Int

  KEYCODE_L As Int

  KEYCODE_LEFT_BRACKET As Int

  KEYCODE_M As Int

  KEYCODE_MEDIA_FAST_FORWARD As Int

  KEYCODE_MEDIA_NEXT As Int

  KEYCODE_MEDIA_PLAY_PAUSE As Int

  KEYCODE_MEDIA_PREVIOUS As Int

  KEYCODE_MEDIA_REWIND As Int

  KEYCODE_MEDIA_STOP As Int

  KEYCODE_MENU As Int

  KEYCODE_MINUS As Int

  KEYCODE_MUTE As Int

  KEYCODE_N As Int

  KEYCODE_NOTIFICATION As Int

  KEYCODE_NUM As Int

  KEYCODE_O As Int

  KEYCODE_P As Int

  KEYCODE_PERIOD As Int

  KEYCODE_PLUS As Int

  KEYCODE_POUND As Int

  KEYCODE_POWER As Int

  KEYCODE_Q As Int

  KEYCODE_R As Int

  KEYCODE_RIGHT_BRACKET As Int

  KEYCODE_S As Int

  KEYCODE_SEARCH As Int

  KEYCODE_SEMICOLON As Int

  KEYCODE_SHIFT_LEFT As Int

  KEYCODE_SHIFT_RIGHT As Int

  KEYCODE_SLASH As Int

  KEYCODE_SOFT_LEFT As Int

  KEYCODE_SOFT_RIGHT As Int

  KEYCODE_SPACE As Int

  KEYCODE_STAR As Int

  KEYCODE_SYM As Int

  KEYCODE_T As Int

  KEYCODE_TAB As Int

  KEYCODE_U As Int

  KEYCODE_UNKNOWN As Int

  KEYCODE_V As Int

  KEYCODE_VOLUME_DOWN As Int

  KEYCODE_VOLUME_UP As Int

  KEYCODE_W As Int

  KEYCODE_X As Int

  KEYCODE_Y As Int

  KEYCODE_Z As Int

Members description:

KEYCODE_0 As Int
KEYCODE_1 As Int
KEYCODE_2 As Int
KEYCODE_3 As Int
KEYCODE_4 As Int
KEYCODE_5 As Int
KEYCODE_6 As Int
KEYCODE_7 As Int
KEYCODE_8 As Int
KEYCODE_9 As Int
KEYCODE_A As Int
KEYCODE_ALT_LEFT As Int
KEYCODE_ALT_RIGHT As Int
KEYCODE_APOSTROPHE As Int
KEYCODE_AT As Int
KEYCODE_B As Int
KEYCODE_BACK As Int
KEYCODE_BACKSLASH As Int
KEYCODE_C As Int
KEYCODE_CALL As Int
KEYCODE_CAMERA As Int
KEYCODE_CLEAR As Int
KEYCODE_COMMA As Int
KEYCODE_D As Int
KEYCODE_DEL As Int
KEYCODE_DPAD_CENTER As Int
KEYCODE_DPAD_DOWN As Int
KEYCODE_DPAD_LEFT As Int
KEYCODE_DPAD_RIGHT As Int
KEYCODE_DPAD_UP As Int
KEYCODE_E As Int
KEYCODE_ENDCALL As Int
KEYCODE_ENTER As Int
KEYCODE_ENVELOPE As Int
KEYCODE_EQUALS As Int
KEYCODE_EXPLORER As Int
KEYCODE_F As Int
KEYCODE_FOCUS As Int
KEYCODE_G As Int
KEYCODE_GRAVE As Int
KEYCODE_H As Int
KEYCODE_HEADSETHOOK As Int
KEYCODE_HOME As Int
KEYCODE_I As Int
KEYCODE_J As Int
KEYCODE_K As Int
KEYCODE_L As Int
KEYCODE_LEFT_BRACKET As Int
KEYCODE_M As Int
KEYCODE_MEDIA_FAST_FORWARD As Int
KEYCODE_MEDIA_NEXT As Int
KEYCODE_MEDIA_PLAY_PAUSE As Int
KEYCODE_MEDIA_PREVIOUS As Int
KEYCODE_MEDIA_REWIND As Int
KEYCODE_MEDIA_STOP As Int
KEYCODE_MENU As Int
KEYCODE_MINUS As Int
KEYCODE_MUTE As Int
KEYCODE_N As Int
KEYCODE_NOTIFICATION As Int
KEYCODE_NUM As Int
KEYCODE_O As Int
KEYCODE_P As Int
KEYCODE_PERIOD As Int
KEYCODE_PLUS As Int
KEYCODE_POUND As Int
KEYCODE_POWER As Int
KEYCODE_Q As Int
KEYCODE_R As Int
KEYCODE_RIGHT_BRACKET As Int
KEYCODE_S As Int
KEYCODE_SEARCH As Int
KEYCODE_SEMICOLON As Int
KEYCODE_SHIFT_LEFT As Int
KEYCODE_SHIFT_RIGHT As Int
KEYCODE_SLASH As Int
KEYCODE_SOFT_LEFT As Int
KEYCODE_SOFT_RIGHT As Int
KEYCODE_SPACE As Int
KEYCODE_STAR As Int
KEYCODE_SYM As Int
KEYCODE_T As Int
KEYCODE_TAB As Int
KEYCODE_U As Int
KEYCODE_UNKNOWN As Int
KEYCODE_V As Int
KEYCODE_VOLUME_DOWN As Int
KEYCODE_VOLUME_UP As Int
KEYCODE_W As Int
KEYCODE_X As Int
KEYCODE_Y As Int
KEYCODE_Z As Int

Typeface

Typeface is a predefined object that holds the typeface styles and the default installed fonts.
Note that unlike most other predefined objects, you can declare new objects of this type.
Example:
EditText1.Typeface = Typeface.DEFAULT_BOLD

Events:

None

Members:


  CreateNew (Typeface1 As android.graphics.Typeface, Style As Int) As android.graphics.Typeface

  DEFAULT As android.graphics.Typeface

  DEFAULT_BOLD As android.graphics.Typeface

  FONTAWESOME As android.graphics.Typeface [read only]

  IsInitialized As Boolean

  LoadFromAssets (FileName As String) As android.graphics.Typeface

  MATERIALICONS As android.graphics.Typeface [read only]

  MONOSPACE As android.graphics.Typeface

  SANS_SERIF As android.graphics.Typeface

  SERIF As android.graphics.Typeface

  STYLE_BOLD As Int

  STYLE_BOLD_ITALIC As Int

  STYLE_ITALIC As Int

  STYLE_NORMAL As Int

Members description:

CreateNew (Typeface1 As android.graphics.Typeface, Style As Int) As android.graphics.Typeface
Returns a typeface with the specified style.
Example:
Typeface.CreateNew(Typeface.MONOSPACE, Typeface.STYLE_ITALIC)
DEFAULT As android.graphics.Typeface
DEFAULT_BOLD As android.graphics.Typeface
FONTAWESOME As android.graphics.Typeface [read only]
IsInitialized As Boolean
LoadFromAssets (FileName As String) As android.graphics.Typeface
Loads a font file, that was added with the file manager.
Example:
Dim MyFont As Typeface
MyFont = Typeface.LoadFromAssets("MyFont.ttf")
EditText1.Typeface = MyFont
MATERIALICONS As android.graphics.Typeface [read only]
MONOSPACE As android.graphics.Typeface
SANS_SERIF As android.graphics.Typeface
SERIF As android.graphics.Typeface
STYLE_BOLD As Int
STYLE_BOLD_ITALIC As Int
STYLE_ITALIC As Int
STYLE_NORMAL As Int

Top