私はこのようなもので、ユーザの入力を読み取るためにアンドロイドに正規表現をウッシングいますが見つかりません私はarduinoにこの入力を送る)アンドロイド正規表現マッチャー
私はユーザーがラインを壊すかどうかを確認する必要があります。もしそうなら、私はarduinoにラインを送ります。行が 'd'(2番目のものと同様)で始まっている場合は、遅延を設定し、その時間はその行の次の整数になります。マッチャが
私は、コンパイルに設定したものが見つかった場合、ここでは私のコードですが、私は検証しようとすると問題がある
final String expression = aux.getCodigo().toString();
//System.out.println("mandeii " + MenuActivity.mIn.read());
Pattern pattern = Pattern.compile("'(\n)'");
Matcher matcher = pattern.matcher(expression);
System.out.println("achei ");
if (matcher.find()){
System.out.println("found the first endLine"+ matcher);
if (matcher.group(0).charAt(0) == 'd') {
System.out.println("achei o d "+matcher.group(0).charAt(0));
int v1 = matcher.group(0).charAt(1);
if (matcher.group(0).charAt(2) != '\n') {
int v2 = matcher.group(0).charAt(2);
int valor = Integer.parseInt(String.valueOf(v1) + String.valueOf(v2));
System.out.println("valor "+valor);
new CountDownTimer(valor * 1000, 1000) {
public void onFinish() {
System.out.println("delayed");
}
public void onTick(long millisUntilFinished) {
// millisUntilFinished The amount of time until finished.
}
}.start();
} else {
new CountDownTimer(v1 * 1000, 1000) {
public void onFinish() {
System.out.println("delayed");
}
public void onTick(long millisUntilFinished) {
// millisUntilFinished The amount of time until finished.
}
}.start();
}
}
else MenuActivity.mOut.write(matcher.group(0).getBytes());
誰かが知っている場合、それは、私に TKSを大いに役立つだろう
を\あなたは'のstring.Split(System.lineSeparatorを()を使用することができますN ' ) ' –