you can also try using hashmap with Integer(0-9) as key and String as value and then store the 10 key value pair as you have specified. also have two arrays key[] and numOfTaps[]. so when you press something like "44335557075557777" , extract each key pressed in key[] array and the num of times it is pressed in numOfTaps[].
for the above example
key[]={4,3,5,7,0,7,5,7}
and numOfTaps={2,2,3,1,1,1,3,4}
then the String (say str) associated with key "key[i]" in your hashmap. (key[0] is 4 so it will have "ghi" as value)
and then get the character as str[numOfTaps[i]] (so u will get "h" for i=0)