public class ChatService
extends Service
Modifier and Type | Field and Description |
---|---|
private int |
MAX_RETRY |
private com.github.nkzawa.socketio.client.Socket |
mSocket |
private java.lang.String |
mSquareId |
static java.lang.String |
NOTIFICATION |
private int |
retryNumber |
private static java.lang.String |
TAG |
Constructor and Description |
---|
ChatService() |
Modifier and Type | Method and Description |
---|---|
IBinder |
onBind(Intent intent) |
int |
onStartCommand(Intent intent,
int flags,
int startId)
Gets the needed data from the intent and calls sendmessage
|
private void |
publishResults(Message m)
Removes the sent message from the list of outgoing messages and notifies it to the ChatActivity if it is open.
|
private void |
sendMessage(JSONObject data,
Message m)
Connects to socket.io and tries to send the message.
|
private static final java.lang.String TAG
public static final java.lang.String NOTIFICATION
private com.github.nkzawa.socketio.client.Socket mSocket
private final int MAX_RETRY
private int retryNumber
private java.lang.String mSquareId
public int onStartCommand(Intent intent, int flags, int startId)
sendMessage(JSONObject, Message)
public IBinder onBind(Intent intent)
private void sendMessage(JSONObject data, Message m)
private void publishResults(Message m)
m
- the message sent