public class Application extends Channel
Application
class allows management of installed and web
applications on MultiScreen-enabled devices. It provides the facilities to
connect, launch and commmunicate with the remote applications.Channel.OnClientConnectListener, Channel.OnClientDisconnectListener, Channel.OnConnectListener, Channel.OnDisconnectListener, Channel.OnErrorListener, Channel.OnMessageListener, Channel.OnReadyListener
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_VALUE_LIBRARY |
static String |
ROUTE_APPLICATION |
static String |
ROUTE_WEBAPPLICATION |
Modifier and Type | Method and Description |
---|---|
void |
connect(Map<String,String> attributes,
Result<Client> result)
Connect to the specified channel.
|
void |
disconnect()
Disconnect from the specified channel.
|
void |
disconnect(boolean stopOnDisconnect,
Result<Client> result)
Disconnect from the specified channel.
|
void |
disconnect(Result<Client> result)
Disconnect from the specified channel.
|
void |
getInfo(Result<ApplicationInfo> result)
Retrieve information for the specified application.
|
void |
install(Result<Boolean> result)
Install the specified application.
|
boolean |
isConnected()
Returns if the channel is connected and the host is ready to listen
for messages.
|
boolean |
isWebapp()
Returns whether the specified application is a web application.
|
void |
setOnConnectListener(Channel.OnConnectListener onConnectListener)
Set the listener for connect events.
|
void |
start(Result<Boolean> result)
Start or launch the specified application.
|
void |
stop(Result<Boolean> result)
Stop the specified application.
|
String |
toString() |
addOnMessageListener, connect, connect, connect, getClients, getId, getUri, isDebug, isSecurityMode, publish, publish, publish, publish, publish, publish, publish, publish, removeAllListeners, removeOnMessageListener, removeOnMessageListeners, removeOnMessageListeners, setConnectionTimeout, setDebug, setOnClientConnectListener, setOnClientDisconnectListener, setOnDisconnectListener, setOnErrorListener, setOnReadyListener, setSecurityMode
public static final String ROUTE_APPLICATION
public static final String ROUTE_WEBAPPLICATION
public static final String PROPERTY_VALUE_LIBRARY
public boolean isConnected()
isConnected
in class Channel
public void getInfo(Result<ApplicationInfo> result)
result
- the asynchronous callback to invoke with the retrieved
ApplicationInfo
public void start(Result<Boolean> result)
result
- the asynchronous callback to invoke with the result of
starting the applicationpublic void stop(Result<Boolean> result)
result
- the asynchronous callback to invoke with the result of
stopping the applicationpublic void install(Result<Boolean> result)
result
- the asynchronous callback to invoke with the result of
installing the applicationpublic void connect(Map<String,String> attributes, Result<Client> result)
public void disconnect()
Channel
disconnect
in class Channel
public void disconnect(Result<Client> result)
Channel
disconnect
in class Channel
result
- the callback to invoke with the result of the disconnect requestpublic void disconnect(boolean stopOnDisconnect, Result<Client> result)
stopOnDisconnect
- stop the TV application, if true. Otherwise, disconnect
and leave the TV application running.result
- the callback to invoke with the result of the disconnect requestpublic void setOnConnectListener(Channel.OnConnectListener onConnectListener)
Channel
null
will remove the listener.setOnConnectListener
in class Channel
public boolean isWebapp()