YGPS/src/com/mediatek/ygps/YgpsActivity.java
private void sendCommand(String command) {
        Log.v("@M_" + TAG, "GPS Command is " + command);
        if (null == command || command.trim().length() == 0) {
            Toast.makeText(this, R.string.command_error, Toast.LENGTH_LONG)
                    .show();
            return;
        }
        int index1 = command.indexOf(COMMAND_START);
        int index2 = command.indexOf(COMMAND_END);
        String com = command;
        if (index1 != -1 && index2 != -1) {
            if (index2 < index1) {
                Toast.makeText(this, R.string.command_error, Toast.LENGTH_LONG)
                        .show();
                return;
            }
            com = com.substring(index1 + 1, index2);
        } else if (index1 != -1) {
            com = com.substring(index1 + 1);
        } else if (index2 != -1) {
            com = com.substring(0, index2);
        }
        mSocketClient.sendCommand(com.trim());
    }
/**
     * Send command to MNL server.
     *
     * @param command
     *            PMTK command to be send
     */
Send command to MNL server.
@param command
PMTK command to be send
Send command to MNL server . @param command PMTK command to be send
private void sendCommand(String command) {
        Log.v("@M_" + TAG, "GPS Command is " + command);
        if (null == command || command.trim().length() == 0) {
            Toast.makeText(this, R.string.command_error, Toast.LENGTH_LONG)
                    .show();
            return;
        }
        int index1 = command.indexOf(COMMAND_START);
        int index2 = command.indexOf(COMMAND_END);
        String com = command;
        if (index1 != -1 && index2 != -1) {
            if (index2 < index1) {
                Toast.makeText(this, R.string.command_error, Toast.LENGTH_LONG)
                        .show();
                return;
            }
            com = com.substring(index1 + 1, index2);
        } else if (index1 != -1) {
            com = com.substring(index1 + 1);
        } else if (index2 != -1) {
            com = com.substring(0, index2);
        }
        mSocketClient.sendCommand(com.trim());
    }
private void sendCommand ( String command ) { Log . v ( "@M_" + TAG , "GPS Command is " + command ) ; if ( null == command || command . trim ( ) . length ( ) == 0 ) { Toast . makeText ( this , R . string . command_error , Toast . LENGTH_LONG ) . show ( ) ; return ; } int index1 = command . indexOf ( COMMAND_START ) ; int index2 = command . indexOf ( COMMAND_END ) ; String com = command ; if ( index1 != - 1 && index2 != - 1 ) { if ( index2 < index1 ) { Toast . makeText ( this , R . string . command_error , Toast . LENGTH_LONG ) . show ( ) ; return ; } com = com . substring ( index1 + 1 , index2 ) ; } else if ( index1 != - 1 ) { com = com . substring ( index1 + 1 ) ; } else if ( index2 != - 1 ) { com = com . substring ( 0 , index2 ) ; } mSocketClient . sendCommand ( com . trim ( ) ) ; }
Send command to MNL server.
Send command to MNL server .