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
then the String (say str) associated with key "key[i]" in your hashmap. (key 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)