Class AppState
The AppState
class represents the current state of the Zello Work app.
To use, retrieve the current AppState
values using the Zello.getAppState(AppState)
method. For specific usage, please see the sample projects.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns an optional external id tag used by Zello Work Server Recording.Returns the most recentError
encountered by the Zello Work app.Returns the network name for the current user.Returns the network in URL for the current user.int
Returns the timer for reconnecting to the network.boolean
Determines if the contacts list for the user is available to display.Returns theStatus
for the current user.Returns the custom status message for the current user.Returns the username of the current user.boolean
Determines if the auto run setting is enabled.boolean
Determines if the Zello Work app is available on the device.boolean
Determines if the sign in request for the user is being cancelled.boolean
Determines if the auto connect channel setting is enabled.boolean
Determines if the Zello Work app is currently configuring.boolean
Determines if the Zello Work app is a custom build.boolean
Determines if the Zello Work app is initializing.boolean
isLocked()
Determines if the Zello Work app is currently locked.boolean
Determines if the Zello Work app is trying to reconnect the user to the network.boolean
Determines if the user is currently signed into a Zello Work network.boolean
Determines if the user is in the process of signing in.boolean
Determines if the user is in the process of signing out.boolean
Determines if the Zello Work app is waiting for the network to be available.void
reset()
Resets theAppState
instance back to the default values.
-
Constructor Details
-
AppState
public AppState()
-
-
Method Details
-
reset
public void reset()Resets the
AppState
instance back to the default values.This method does not affect the state of the Zello SDK. This method only resets the values for this copied instance of the
AppState
. -
clone
-
isAvailable
public boolean isAvailable()Determines if the Zello Work app is available on the device.
This method returns
false
if the Zello Work app is not installed on the device or if the app is in a state of error.- Returns:
- boolean indicating if the app is available to communicate with.
-
isInitializing
public boolean isInitializing()Determines if the Zello Work app is initializing.- Returns:
- boolean indicating if the app is initializing.
-
isCustomBuild
public boolean isCustomBuild()Determines if the Zello Work app is a custom build.
This method returns true if the PTT APK was downloaded from zellowork.com.
- Returns:
- boolean indicating if the app is a custom build.
-
isConfiguring
public boolean isConfiguring()Determines if the Zello Work app is currently configuring.- Returns:
- boolean indicating if the app is currently configuring.
-
isLocked
public boolean isLocked()Determines if the Zello Work app is currently locked.
If the Zello Work app is locked, the UI only displays an information screen with the name of your app that can be clicked to open the main activity. Being locked does NOT interfere with the sending and receiving of messages through the Zello Work app.
- Returns:
- boolean indicating if the app is currently locked.
- See Also:
-
isSignedIn
public boolean isSignedIn()Determines if the user is currently signed into a Zello Work network.- Returns:
- boolean indicating if the user is signed in.
- See Also:
-
isSigningIn
public boolean isSigningIn()Determines if the user is in the process of signing in.- Returns:
- boolean indicating if the user is signing in.
- See Also:
-
isSigningOut
public boolean isSigningOut()Determines if the user is in the process of signing out.- Returns:
- boolean indicating if the user is signing out.
- See Also:
-
isCancellingSignin
public boolean isCancellingSignin()Determines if the sign in request for the user is being cancelled.
This method returns
true
if theZello.cancelSignIn()
method is called and cancellation hasn't completed yet.- Returns:
- boolean indicating if the authentication request is being cancelled.
- See Also:
-
isReconnecting
public boolean isReconnecting()Determines if the Zello Work app is trying to reconnect the user to the network.- Returns:
- boolean indicating if the app is trying to reconnect the user.
-
isWaitingForNetwork
public boolean isWaitingForNetwork()Determines if the Zello Work app is waiting for the network to be available.
If the Android OS reports that there is no internet connection, the Zello Work app waits for the connection to become available and this method returns
true
. When internet connection is restored, the Zello Work app signs in automatically.- Returns:
- boolean indicating if the app is waiting for the network.
-
isAutoRunEnabled
public boolean isAutoRunEnabled()Determines if the auto run setting is enabled.
The auto run feature determines if Zello Work app should be launched on the start of the OS or not. This feature can be enabled or disabled using the
Zello.setAutoRun(boolean)
method.- Returns:
- boolean indicating whether or not auto run is enabled.
- See Also:
-
isChannelAutoConnectEnabled
public boolean isChannelAutoConnectEnabled()Determines if the auto connect channel setting is enabled.
The auto connect channel feature determines whether or not any new channel that the user is added to should automatically connect.
- Returns:
- boolean indicating whether or not auto connect channels is enabled.
- See Also:
-
getReconnectTimer
public int getReconnectTimer()Returns the timer for reconnecting to the network.- Returns:
- The network reconnect timer in seconds.
-
getShowContacts
public boolean getShowContacts()Determines if the contacts list for the user is available to display.
When
true
, it is possible to useZello.getContacts()
to fetch the list of the contacts even when user is not online. The last cached copy of the list is returned in this case.- Returns:
- boolean indicating if the contacts should be shown or not.
-
getStatus
Returns theStatus
for the current user.- Returns:
- The current
Status
for the user. - See Also:
-
getStatusMessage
Returns the custom status message for the current user.- Returns:
- Nullable; The status message for the user.
- See Also:
-
getNetwork
Returns the network name for the current user.- Returns:
- Nullable; The network String.
- See Also:
-
getNetworkUrl
Returns the network in URL for the current user.- Returns:
- Nullable; The network URL.
- See Also:
-
getUsername
Returns the username of the current user.- Returns:
- Nullable; The username for the user.
- See Also:
-
getLastError
Returns the most recent
Error
encountered by the Zello Work app.Error.NONE
is returned if there were no errors.- Returns:
Error
type indicating the latest error.
-
getExternalId
Returns an optional external id tag used by Zello Work Server Recording.
This method returns null unless the Zello Work Server Recording feature is turned on for the current network.
- Returns:
- Nullable; The external id for the app.
- See Also:
-