public static final class Router.Intent
extends java.lang.Object
Router.MsgKey
.
the api includes the following groups of intent actions:
A sample scenario of using intenting api to interact with GroupService consists of the following:
//first we register to handle broadcast intents for receiving //messages and events from Router services: IntentFilter filter = new IntentFilter(); filter.addAction(Router.ACTION_RECV_MSG); filter.addAction(Router.ACTION_PEER_JOIN); ...... registerReceiver(mReceiver, filter); //then send intents to Router services to do initialization: Intent intent = new Intent(Router.ACTION_JOIN_GROUP); intent.putExtra(Router.GROUP_ID, groupId); startService(intent);
Intent intent = new Intent(Router.ACTION_SEND_MSG); intent.putExtra(Router.GROUP_ID, groupId); intent.putExtra(Router.MSG_DATA, msg.getBytes()); startService(intent);
//first we send intent to Router services to inform we are leaving: Intent intent = new Intent(Router.ACTION_LEAVE_GROUP); intent.putExtra(Router.GROUP_ID, groupId); startService(intent); //at last unregister BroadcastReceiver and stop receiving messages and events from Router services. unregisterReceiver(mReceiver);
For detailed tutorial on how to use intents to talk to ConnectionService and set up peer device connections, please check out the following github sample project.
For detailed tutorial on how to use intents talk to GroupService and send/receive messages to peers, please check out the github sample project.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_ACCEPT_CONNECTION
intent action name for accepting a peer's connection request.
|
static java.lang.String |
ACTION_ACTIVATE_NETWORK
intent action name for request and reply to activate
a network for use to discover and connect peer devices.
|
static java.lang.String |
ACTION_CONNECT
intent action name for request to connect to a peer device.
|
static java.lang.String |
ACTION_CONNECT_NETWORK
intent action name for connecting to a network
|
static java.lang.String |
ACTION_CONNECTED
intent action name to notify client that a peer connected.
|
static java.lang.String |
ACTION_CONNECTING
intent action name to notify client that a peer device is trying
to connect.
|
static java.lang.String |
ACTION_CONNECTION_FAILED
intent action name to notify client that connection to peer failed.
|
static java.lang.String |
ACTION_CONNECTION_MANAGEMENT
intent action name to bring up external ConnectionManager apps.
|
static java.lang.String |
ACTION_CONNECTION_SERVICE
intent action name to allow client bind to ConnectionService.
|
static java.lang.String |
ACTION_CONNECTION_SETTINGS
intent action name to bring up external ConnectionSettings apps.
|
static java.lang.String |
ACTION_CONNECTOR
intent action name to bring up external Connector apps.
|
static java.lang.String |
ACTION_DENY_CONNECTION
intent action name for denying peer's connection request.
|
static java.lang.String |
ACTION_DISCONNECT
intent action name for request to disconnect a peer device.
|
static java.lang.String |
ACTION_DISCONNECT_NETWORK
intent action name for disconnecting a network
|
static java.lang.String |
ACTION_DISCONNECTED
intent action name to notify client that a peer disconnected.
|
static java.lang.String |
ACTION_ERROR
intent action name for Router to return error messages to clients.
|
static java.lang.String |
ACTION_GET_ACTIVE_NETWORK
intent action name for request and reply info of the network
currently used to discover and connect peer devices.
|
static java.lang.String |
ACTION_GET_CONNECTED_PEERS
intent action name for request and reply to get connected peer device info.
|
static java.lang.String |
ACTION_GET_CONNECTION_INFO
intent action names for request and reply of connection related info at ConnectionService.
|
static java.lang.String |
ACTION_GET_DEVICE_INFO
intent action names for request and reply of my device info at ConnectionService.
|
static java.lang.String |
ACTION_GET_NETWORKS
intent action name for request and reply info of networks
currently attached to device.
|
static java.lang.String |
ACTION_GROUP_SERVICE
intent action name to allow client bind to GroupService.
|
static java.lang.String |
ACTION_JOIN_GROUP
intent action name for request to join a group
|
static java.lang.String |
ACTION_LEAVE_GROUP
intent action name for request to leave a group
|
static java.lang.String |
ACTION_MESSENGER_SERVICE
intent action name to allow clients bind to Messenger service.
|
static java.lang.String |
ACTION_NETWORK_CONNECTED
intent action name to notify clients device is attached to
a new network.
|
static java.lang.String |
ACTION_NETWORK_CONNECTING
intent action name to notify clients that is connecting to a network
|
static java.lang.String |
ACTION_NETWORK_CONNECTION_FAILED
intent action name to notify client that a connect attempt to network failed
|
static java.lang.String |
ACTION_NETWORK_DISCONNECTED
intent action name to notify clients device is detached from
a network.
|
static java.lang.String |
ACTION_PEER_JOIN
intent action name to notify client a peer device joined group.
|
static java.lang.String |
ACTION_PEER_LEAVE
intent action name to notify client a peer device left group.
|
static java.lang.String |
ACTION_RECV_MSG
intent action name to notify client to receive a message from peers.
|
static java.lang.String |
ACTION_REMOTE_INTENT_SERVICE
intent action name to bind to remote intent service
|
static java.lang.String |
ACTION_ROUTER_CLEAR
notify other components that Router services are reset.
|
static java.lang.String |
ACTION_ROUTER_DOWN
notify other components that Router service shuts down.
|
static java.lang.String |
ACTION_ROUTER_RESET
intent action name to request a Router reset; all active peer connection will be disconnected;
other components in system can watch for this intent and do their cleanup accordingly.
|
static java.lang.String |
ACTION_ROUTER_SHUTDOWN
intent action name to request Router shutdown.
|
static java.lang.String |
ACTION_ROUTER_STARTUP
intent action name for starting up Router services.
|
static java.lang.String |
ACTION_ROUTER_UP
notify other components in system that Router services is up and ready;
they can start their startup process.
|
static java.lang.String |
ACTION_SEARCH_COMPLETE
intent action name to notify clients that search session completed, either because search session time out or client stoped search explicitly.
|
static java.lang.String |
ACTION_SEARCH_FOUND_DEVICE
intent action name to notify client that new device found
during search.
|
static java.lang.String |
ACTION_SEARCH_START
intent action name to notify client the search session started.
|
static java.lang.String |
ACTION_SELF_JOIN
intent action name to notify client it has successfully joined a group.
|
static java.lang.String |
ACTION_SELF_LEAVE
intent action name to notify client it has left a group.
|
static java.lang.String |
ACTION_SEND_MSG
intent action name to send a message to peers.
|
static java.lang.String |
ACTION_SEND_REMOTE_BROADCAST |
static java.lang.String |
ACTION_SERVICE
generic intent action name for Router services
|
static java.lang.String |
ACTION_SET_CONNECTION_INFO
intent action names for request and reply of setting connection related info in ConnectionService.
|
static java.lang.String |
ACTION_START_REMOTE_ACTIVITY |
static java.lang.String |
ACTION_START_REMOTE_ACTIVITY_FOR_RESULT |
static java.lang.String |
ACTION_START_REMOTE_SERVICE |
static java.lang.String |
ACTION_START_SEARCH
intent action name for request to start a new peer search session.
|
static java.lang.String |
ACTION_STOP_SEARCH
intent action name for request to stop current active peer search session.
|
Constructor and Description |
---|
Intent() |
public static final java.lang.String ACTION_SERVICE
public static final java.lang.String ACTION_CONNECTION_SERVICE
public static final java.lang.String ACTION_GROUP_SERVICE
public static final java.lang.String ACTION_MESSENGER_SERVICE
public static final java.lang.String ACTION_CONNECTOR
public static final java.lang.String ACTION_CONNECTION_MANAGEMENT
public static final java.lang.String ACTION_CONNECTION_SETTINGS
public static final java.lang.String ACTION_REMOTE_INTENT_SERVICE
public static final java.lang.String ACTION_ROUTER_STARTUP
public static final java.lang.String ACTION_ROUTER_RESET
public static final java.lang.String ACTION_ROUTER_SHUTDOWN
public static final java.lang.String ACTION_ROUTER_UP
public static final java.lang.String ACTION_ROUTER_CLEAR
public static final java.lang.String ACTION_ROUTER_DOWN
public static final java.lang.String ACTION_ERROR
Message Data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_CONNECT_NETWORK
Reply Message Data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_DISCONNECT_NETWORK
Reply Message Data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_GET_NETWORKS
Reply Message Data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_GET_ACTIVE_NETWORK
Reply message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_ACTIVATE_NETWORK
Request and reply message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_NETWORK_CONNECTED
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_NETWORK_DISCONNECTED
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_NETWORK_CONNECTING
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_NETWORK_CONNECTION_FAILED
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_START_SEARCH
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_STOP_SEARCH
public static final java.lang.String ACTION_SEARCH_START
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_SEARCH_FOUND_DEVICE
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_SEARCH_COMPLETE
public static final java.lang.String ACTION_CONNECT
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_DISCONNECT
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_ACCEPT_CONNECTION
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_DENY_CONNECTION
Message data is a bundle indexed by MsgKey:
Connection Failure code
for the reason of denial.public static final java.lang.String ACTION_CONNECTING
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_CONNECTION_FAILED
Message data is a bundle indexed by MsgKey:
Connection Failure code
for the reason of denial.public static final java.lang.String ACTION_CONNECTED
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_DISCONNECTED
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_SET_CONNECTION_INFO
Request message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_GET_CONNECTION_INFO
Reply message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_GET_DEVICE_INFO
Reply message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_JOIN_GROUP
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_LEAVE_GROUP
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_SELF_JOIN
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_PEER_JOIN
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_SELF_LEAVE
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_PEER_LEAVE
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_SEND_MSG
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_RECV_MSG
Message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_GET_CONNECTED_PEERS
Request message data is a bundle indexed by MsgKey:
Reply message data is a bundle indexed by MsgKey:
public static final java.lang.String ACTION_START_REMOTE_ACTIVITY
public static final java.lang.String ACTION_START_REMOTE_ACTIVITY_FOR_RESULT
public static final java.lang.String ACTION_START_REMOTE_SERVICE
public static final java.lang.String ACTION_SEND_REMOTE_BROADCAST