Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
Android Documentation
Alert

Class Alert

Hierarchy

java.lang.Object
     com.smartdevicelink.proxy.RPCStruct
         com.smartdevicelink.proxy.RPCMessage
             com.smartdevicelink.proxy.RPCRequest

Package
com.smartdevicelink.proxy.rpc

Overview

Provides information to the user using either TTS, the Display or both and can include a system-generated alert tone.

If connecting to SDL Core v.6.0+, the alert can be canceled programmatically using the `cancelID`. Canceling will not dismiss the alert's speech - only the modal view will be dismissed. On older versions of SDL Core, the alert will persist until the user has interacted with the alert or the specified timeout has elapsed.

  • The displayed portion of the Alert, if any, will persist until the specified timeout has elapsed, or the Alert is preempted
  • An Alert will preempt (abort) any SmartDeviceLink Operation that is in-progress, except an already-in-progress Alert
  • An Alert cannot be preempted by any SmartDeviceLink Operation
  • An Alert can be preempted by a user action (button push)
  • An Alert will fail if it is issued while another Alert is in progress
  • Although each Alert parameter is optional, in fact each Alert request must supply at least one of the following parameters:
    • alertText1
    • alertText2
    • alertText3
    • ttsChunks

HMILevel needs to be FULL or LIMITED.

If the app has been granted function group Notification the HMILevel can also be BACKGROUND
Name Type Description Req. Notes Version Available
alertText1 String Text to be displayed in the first field of the display during the Alert. N Length is limited to what is indicated in RegisterAppInterface response. If omitted, top display line will be cleared. Text is always centered SmartDeviceLink 1.0
alertText2 String Text to be displayed in the second field of the display during the Alert. N Only permitted if HMI supports a second display line. Length is limited to what is indicated in RegisterAppInterface response. If omitted, second display line will be cleared. SmartDeviceLink 1.0
alertText3 String Text to be displayed in the third field of the display during the Alert. N Array must have a least one element. SmartDeviceLink 1.0
ttsChunks TTSChunk[] Array of type TTSChunk which, taken together, specify what is to be spoken to the user. N Array must have a least one element. SmartDeviceLink 1.0
duration Integer The duration of the displayed portion of the alert, in milliseconds. After this amount of time has passed, the display fields alertText1 and alertText2 will revert to what was displayed in those fields before the alert began. N Min Value: 3000 Max Value: 10000. If omitted, the default is 5000 milliseconds SmartDeviceLink 1.0
playTone Boolean Specifies whether the alert tone should be played before the TTS (if any) is spoken. N If omitted, default is true. SmartDeviceLink 1.0
softButtons SoftButton[] Specifies the soft buttons, the apps wants to use in this alert. N If omitted on supported displays, the alert will not have any SoftButton.ArrayMin: 0; ArrayMax: 4 SmartDeviceLink 1.0
progressIndicator Boolean If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc. N SmartDeviceLink 1.0
cancelID Integer An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC. N SmartDeviceLink 6.0
alertIcon Image Image struct determining whether the icon is static or dynamic. If omitted on supported displays, no (or the default if applicable) icon should be displayed. N SmartDeviceLink 6.0.0

Fields

KEY_PLAY_TONE

public static final java.lang.String KEY_PLAY_TONE
Constant Value
"playTone"

KEY_DURATION

public static final java.lang.String KEY_DURATION
Constant Value
"duration"

KEY_ALERT_TEXT_1

public static final java.lang.String KEY_ALERT_TEXT_1
Constant Value
"alertText1"

KEY_ALERT_TEXT_2

public static final java.lang.String KEY_ALERT_TEXT_2
Constant Value
"alertText2"

KEY_ALERT_TEXT_3

public static final java.lang.String KEY_ALERT_TEXT_3
Constant Value
"alertText3"

KEY_PROGRESS_INDICATOR

public static final java.lang.String KEY_PROGRESS_INDICATOR
Constant Value
"progressIndicator"

KEY_TTS_CHUNKS

public static final java.lang.String KEY_TTS_CHUNKS
Constant Value
"ttsChunks"

KEY_SOFT_BUTTONS

public static final java.lang.String KEY_SOFT_BUTTONS
Constant Value
"softButtons"

KEY_CANCEL_ID

public static final java.lang.String KEY_CANCEL_ID
Constant Value
"cancelID"

KEY_ALERT_ICON

public static final java.lang.String KEY_ALERT_ICON
Constant Value
"alertIcon"

Inherited Fields

From Class Fields
com.smartdevicelink.proxy.RPCRequest onResponseListener
com.smartdevicelink.proxy.RPCMessage KEY_REQUEST, KEY_RESPONSE, KEY_NOTIFICATION, KEY_FUNCTION_NAME, KEY_PARAMETERS, KEY_CORRELATION_ID, messageType, parameters, function
com.smartdevicelink.proxy.RPCStruct KEY_BULK_DATA, KEY_PROTECTED, store

Constructors

Alert()

Constructs a new Alert object

public Alert()

Alert( java.util.Hashtable<java.lang.String, java.lang.Object> hash )

Constructs a new Alert object indicated by the Hashtable parameter

public Alert(java.util.Hashtable<java.lang.String, java.lang.Object> hash)

Constructor Parameters

hash
The Hashtable to use

Methods

getAlertText1()

Gets the text which is displayed in the first field of the display during the Alert

public java.lang.String getAlertText1()

setAlertText1( String alertText1 )

Sets the String to be displayed in the first field of the display during the Alert

public com.smartdevicelink.proxy.rpc.Alert setAlertText1(String alertText1)

Method Parameters

alertText1
a String value representing the text which is displayed in the first field during the Alert

getAlertText2()

Gets the text which is displayed in the second field of the display during the Alert

public java.lang.String getAlertText2()

setAlertText2( String alertText2 )

Sets the String to be displayed in the second field of the display during the Alert

public com.smartdevicelink.proxy.rpc.Alert setAlertText2(String alertText2)

Method Parameters

alertText2
a String value representing the text which is displayed in the third field during the Alert

getAlertText3()

Gets the text which is displayed in the third field of the display during the Alert

public java.lang.String getAlertText3()

setAlertText3( String alertText3 )

Sets the String to be displayed in the third field of the display during the Alert

public com.smartdevicelink.proxy.rpc.Alert setAlertText3(String alertText3)

Method Parameters

alertText3
a String value representing the text which is displayed in the third field during the Alert

getTtsChunks()

Gets TTSChunk[], the Array of type TTSChunk which, taken together, specify what is to be spoken to the user

public java.util.List getTtsChunks()

setTtsChunks( java.util.List<com.smartdevicelink.proxy.rpc.TTSChunk> ttsChunks )

Sets array of type TTSChunk which, taken together, specify what is to be spoken to the user

public com.smartdevicelink.proxy.rpc.Alert setTtsChunks(java.util.List<com.smartdevicelink.proxy.rpc.TTSChunk> ttsChunks)

Method Parameters

ttsChunks

Notes: Array must have a least one element

getDuration()

Gets the duration of the displayed portion of the alert, in milliseconds

public java.lang.Integer getDuration()

setDuration( Integer duration )

Sets the duration of the displayed portion of the alert, in milliseconds. After this amount of time has passed, the display fields alertText1 and alertText2 will revert to what was displayed in those fields before the alert began

public com.smartdevicelink.proxy.rpc.Alert setDuration(Integer duration)

Method Parameters

duration
-an Integer value representing the duration of the displayed portion of the alert, in milliseconds

getPlayTone()

Gets a Boolean value representing the alert tone

public java.lang.Boolean getPlayTone()

setPlayTone( Boolean playTone )

Sets whether the alert tone should be played before the TTS (if any) is spoken

public com.smartdevicelink.proxy.rpc.Alert setPlayTone(Boolean playTone)

Method Parameters

playTone
a Boolean value which specifies whether the alert tone should be played before the TTS (if any) is spoken.

Notes: If omitted, default is true

getSoftButtons()

Gets the SoftButton List object

public java.util.List getSoftButtons()

setSoftButtons( java.util.List<com.smartdevicelink.proxy.rpc.SoftButton> softButtons )

Sets the SoftButtons

public com.smartdevicelink.proxy.rpc.Alert setSoftButtons(java.util.List<com.smartdevicelink.proxy.rpc.SoftButton> softButtons)

Method Parameters

softButtons
a List value. If omitted on supported displays, the alert will not have any SoftButton. ArrayMin: 0. ArrayMax: 4.

getProgressIndicator()

Gets a Boolean value representing the progress indicator

public java.lang.Boolean getProgressIndicator()

setProgressIndicator( Boolean progressIndicator )

Sets whether the progress indicator should be shown

public com.smartdevicelink.proxy.rpc.Alert setProgressIndicator(Boolean progressIndicator)

Method Parameters

progressIndicator
A Boolean value which specifies whether the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.

getCancelID()

Gets an Integer value representing the cancel ID

public java.lang.Integer getCancelID()

setCancelID( Integer cancelID )

Sets the cancel ID

public com.smartdevicelink.proxy.rpc.Alert setCancelID(Integer cancelID)

Method Parameters

cancelID
An Integer ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.

setAlertIcon( Image alertIcon )

Sets the Image If provided, defines the image to be shown along with the alert

public com.smartdevicelink.proxy.rpc.Alert setAlertIcon(Image alertIcon)

Method Parameters

alertIcon
an Image object representing the Image shown along with the alert. Notes: If omitted on supported displays, no (or the default if applicable) icon will be displayed

getAlertIcon()

Gets the image to be shown along with the alert

public com.smartdevicelink.proxy.rpc.Image getAlertIcon()

Inherited Methods

From Class Methods
com.smartdevicelink.proxy.RPCRequest getCorrelationID, setCorrelationID, setOnRPCResponseListener, getOnRPCResponseListener
com.smartdevicelink.proxy.RPCMessage getFunctionID, getFunctionName, setFunctionName, getMessageType, setParameters, getParameters, getObject, getString, getInteger, getFloat, getDouble, getBoolean, getLong
com.smartdevicelink.proxy.RPCStruct getStoreValue, getStore, deserializeJSON, serializeJSON, serializeJSON, format, getBulkData, setBulkData, setPayloadProtected, isPayloadProtected, getMessageTypeName, hasKey, setValue, getValue, getObject, formatObject, getValueForString, getString, getInteger, getDouble, getFloat, getBoolean, getLong, clone, equals, hashCode
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section