@Override public IChatMessage sendMessage(String message) throws RemoteException {
  if (TextUtils.isEmpty(message)) {
    throw new ServerApiIllegalArgumentException("message must not be null or empty!");
  }
  int messageLength=message.length();
  int maxMessageLength=mRcsSettings.getMaxChatMessageLength();
  if (messageLength > maxMessageLength) {
    throw new ServerApiIllegalArgumentException("chat message length: " + messageLength + " exeeds max chat message length: "+ maxMessageLength+ "!");
  }
  if (sLogger.isActivated()) {
    sLogger.debug("Send text message.");
  }
  try {
    mImService.removeOneToOneChatComposingStatus(mContact);
    long timestamp=System.currentTimeMillis();
    final ChatMessage msg=ChatUtils.createTextMessage(mContact,message,timestamp,timestamp);
    ChatMessagePersistedStorageAccessor persistedStorage=new ChatMessagePersistedStorageAccessor(mMessagingLog,msg.getMessageId(),msg.getRemoteContact(),message,msg.getMimeType(),mContact.toString(),Direction.OUTGOING);
    addOutgoingChatMessage(msg,Status.QUEUED);
    mImService.tryToDequeueOneToOneChatMessages(mContact);
    return new ChatMessageImpl(persistedStorage);
  }
 catch (  ServerApiBaseException e) {
    if (!e.shouldNotBeLogged()) {
      sLogger.error(ExceptionUtil.getFullStackTrace(e));
    }
    throw e;
  }
catch (  Exception e) {
    sLogger.error(ExceptionUtil.getFullStackTrace(e));
    throw new ServerApiGenericException(e);
  }
}

@ Override public IChatMessage sendMessage ( String message ) throws RemoteException { if ( TextUtils . isEmpty ( message ) ) { throw new ServerApiIllegalArgumentException ( "message must not be null or empty!" ) ; } int messageLength = message . length ( ) ; int maxMessageLength = mRcsSettings . getMaxChatMessageLength ( ) ; if ( messageLength > maxMessageLength ) { throw new ServerApiIllegalArgumentException ( "chat message length: " + messageLength + " exeeds max chat message length: " + maxMessageLength + "!" ) ; } if ( sLogger . isActivated ( ) ) { sLogger . debug ( "Send text message." ) ; } try { mImService . removeOneToOneChatComposingStatus ( mContact ) ; long timestamp = System . currentTimeMillis ( ) ; final ChatMessage msg = ChatUtils . createTextMessage ( mContact , message , timestamp , timestamp ) ; ChatMessagePersistedStorageAccessor persistedStorage = new ChatMessagePersistedStorageAccessor ( mMessagingLog , msg . getMessageId ( ) , msg . getRemoteContact ( ) , message , msg . getMimeType ( ) , mContact . toString ( ) , Direction . OUTGOING ) ; addOutgoingChatMessage ( msg , Status . QUEUED ) ; mImService . tryToDequeueOneToOneChatMessages ( mContact ) ; return new ChatMessageImpl ( persistedStorage ) ; } catch ( ServerApiBaseException e ) { if ( ! e . shouldNotBeLogged ( ) ) { sLogger . error ( ExceptionUtil . getFullStackTrace ( e ) ) ; } throw e ; } catch ( Exception e ) { sLogger . error ( ExceptionUtil . getFullStackTrace ( e ) ) ; throw new ServerApiGenericException ( e ) ; } }
sends a plain text message
