List of usage examples for android.media ToneGenerator TONE_DTMF_8
int TONE_DTMF_8
To view the source code for android.media ToneGenerator TONE_DTMF_8.
Click Source Link
From source file:Main.java
/** Returns a string character that represents the tone type. if input is * invalid, then returns an empty string. */ public static String getStringFromToneType(int toneType) { switch (toneType) { case ToneGenerator.TONE_DTMF_0: return "0"; case ToneGenerator.TONE_DTMF_1: return "1"; case ToneGenerator.TONE_DTMF_2: return "2"; case ToneGenerator.TONE_DTMF_3: return "3"; case ToneGenerator.TONE_DTMF_4: return "4"; case ToneGenerator.TONE_DTMF_5: return "5"; case ToneGenerator.TONE_DTMF_6: return "6"; case ToneGenerator.TONE_DTMF_7: return "7"; case ToneGenerator.TONE_DTMF_8: return "8"; case ToneGenerator.TONE_DTMF_9: return "9"; case ToneGenerator.TONE_DTMF_A: return "A"; case ToneGenerator.TONE_DTMF_B: return "B"; case ToneGenerator.TONE_DTMF_C: return "C"; case ToneGenerator.TONE_DTMF_D: return "D"; case ToneGenerator.TONE_DTMF_P: return "#"; case ToneGenerator.TONE_DTMF_S: return "*"; default:// w w w . jav a2 s .c o m return ""; } }
From source file:Main.java
/** Returns the tone type that the string character represents. If input is * empty, then returns -1. *///from w w w. j a v a2 s . co m public static int getToneTypeFromString(String toneString) { if (TextUtils.isEmpty(toneString)) { return -1; } if (toneString.equalsIgnoreCase("0")) { return ToneGenerator.TONE_DTMF_0; } else if (toneString.equalsIgnoreCase("1")) { return ToneGenerator.TONE_DTMF_1; } else if (toneString.equalsIgnoreCase("2")) { return ToneGenerator.TONE_DTMF_2; } else if (toneString.equalsIgnoreCase("3")) { return ToneGenerator.TONE_DTMF_3; } else if (toneString.equalsIgnoreCase("4")) { return ToneGenerator.TONE_DTMF_4; } else if (toneString.equalsIgnoreCase("5")) { return ToneGenerator.TONE_DTMF_5; } else if (toneString.equalsIgnoreCase("6")) { return ToneGenerator.TONE_DTMF_6; } else if (toneString.equalsIgnoreCase("7")) { return ToneGenerator.TONE_DTMF_7; } else if (toneString.equalsIgnoreCase("8")) { return ToneGenerator.TONE_DTMF_8; } else if (toneString.equalsIgnoreCase("9")) { return ToneGenerator.TONE_DTMF_9; } else if (toneString.equalsIgnoreCase("A")) { return ToneGenerator.TONE_DTMF_A; } else if (toneString.equalsIgnoreCase("B")) { return ToneGenerator.TONE_DTMF_B; } else if (toneString.equalsIgnoreCase("C")) { return ToneGenerator.TONE_DTMF_C; } else if (toneString.equalsIgnoreCase("D")) { return ToneGenerator.TONE_DTMF_D; } else if (toneString.equalsIgnoreCase("#")) { return ToneGenerator.TONE_DTMF_P; } else if (toneString.equalsIgnoreCase("*")) { return ToneGenerator.TONE_DTMF_S; } return ToneGenerator.TONE_DTMF_0; // Error if code reaches here. }