Rasmus on Type Nine
We were really excited to talk with Rasmus Porsager, the creator of Type Nine, not only because his app has received some good press, but because we loved the idea behind it. If, like us, you’re old enough to remember the days when you had to use the number keys to text on cell phones, you’ll immediately feel at home with Type Nine. The application combines old-school design with modern technology to create a pretty unique keyboard. We were eager to find out more about the app and its creator…
Tim Anglade, VP of Product at Realm: Thank you so much for taking the time to chat. You’re one of our many users in Copenhagen, right? You’re based in Denmark?
Rasmus Porsager: Yeah.
Tim: Cool. How did you hear about Realm?
Rasmus: That’s a good question. I don’t know if I read about it on Hacker News or if it was— actually, I think I was having an issue with something in Core Data, and then when I looked for a solution I saw someone referencing Realm.
T: Nice. We have an office there, and I know Brian, our VP of Engineering, has been going around and doing a lot of meetups in Copenhagen. That’s usually how people hear about us there. But you learned about us through the Internet. That’s great.
How did you first get into app development?
T: Cool, so you went into .NET and you’ve been mostly building .NET applications with Xamarin since then?
R: Yeah, actually, at my day job, we make a music streaming service where our applications are also made in .NET.
So you’re building apps on the side, and the app we’re talking about today is called Type Nine. It’s a keyboard for iOS with T9 input — people type on a number keypad, like a phone pad, and you guess the words from the input.
Where did the idea for the app come from? It seems like a very retro idea in some ways. I’m wondering how you came up with it?
R: It actually started out when I just wanted to check out Swift and see how it worked. For a long time, I’d been annoyed at how many times I was using the delete button on the iPhone keyboard. When you switch between multiple languages on the iPhone, for example English and Danish, you don’t always remember to switch the keyboard to the proper language. So when you write English with the Danish keyboard, it inserts Danish words.
Then auto-completion annoys you, and you have to delete the word that you didn’t want.
T: I get really pissed off at that too. I feel like they don’t have a lot of people at Apple who use multiple languages on a daily basis, because otherwise they would be very aware of how painful that experience is. I go between French and English all the time because I’m from France, and yeah, it’s always very painful that they don’t handle that kind of scenario very well. I can definitely relate to your pain.
R: Then I remembered how fast I was with T9 just before the iPhone, and I knew it would be a problem doing it on the iPhone because you don’t have the tactile feedback. So you can’t really type without looking.
I thought it would be fun to make a quick prototype trying to figure out how Swift worked, and then when I had it ready, I realized it was extremely nice to type on.
T: Cool. I saw you got some good press with the application. I think a lot of people echoed your desire for an old-school phone-style keyboard interface.
R: I think many people looked at it and saw the nostalgic part of it, but then really took a further look and saw that you can actually type pretty well with it.
T: Yeah, on the website I was surprised. You don’t go for the retro angle in the design; it’s a modern, fresh look, and I really love that. It started with a retro idea, but just to be clear, it’s not a joke application. It’s actually a very functional, useful keyboard.
R: Exactly, yeah.
T: Can you talk a bit about how the app is structured and maybe what you’re most proud about inside the application?
R: I think the part I’m most proud about is handling Apple’s SDK, because boy was that tricky. I mean, there’s some funny stuff going on. When you design a keyboard, you only have access to a function to insert text in the input field, and there you can insert x amount of characters or a string. Then to delete something, you can’t delete a single character at a time, so you have to call function to delete character.
If you want to delete more, you really need to handle the strings and there are a lot of shortcomings in some places. For example, if you start out a sentence, until you type a symbol or a space, it seems like you can ask which text is in the input field, and that’s not always up to date with what’s actually there. So you may end up with a whole layer on top of it to make sure that you can use the… how to explain this?
T: Use the actual string that’s input and you’re not looking at an old buffer?
R: Exactly. And then you only call their functions when you really need to.
T: It’s a very fresh API. It’s very recent, right? I think it may get a little bit more polished soon, and it’s just what they needed to use internally for the iOS 7 keyboards. Hopefully it will improve.
R: Hopefully. A funny thing is, if you go into Contacts on the iPhone and use any custom keyboard out there and try to edit a contact, when you press the delete button, it will jump to the next text field. It’s stuff like this where people contact me and say, “It’s writing like crazy.”
T: I’ve noticed quite a few things like that too. For example, I know in a lot of Google applications you don’t get suggestions unless you use the default keyboard. If you use a third-party keyboard, that doesn’t work. And it seems like people really build their apps in a way that assumes there’s only one keyboard. There’s definitely quite a few updates that are probably needed in those APIs from Apple’s side.
So, what do you use Realm for inside this application?
R: That’s actually the other part of the app that I think is really nice. I started out with Core Data and I had to spend so much time figuring out how to make it work well and get some performance out of it. Several times I considered going to another SQLite wrapper just to figure out if that would work better.
When I found Realm and I looked at the examples, I thought, “I’m just going to try this out really quick,” because I was almost done with everything in Core Data. Then in about half an hour, I had something that worked much better.
R: So I decided to dump Core Data.
T: So you were almost done, but you still had some doubts. When you say it worked better, what do you mean? Was it working faster? Was it cleaner code?
R: Clean implementation and much faster performance.
T: I’m assuming you use it to store kind of a tree of possible words that people may be inputting with the numbers of the keyboard and try to guess which word they’re wanting to input?
R: Yeah, exactly. I’ve built some dictionaries from a lot of frequency lists, both from subtitles and Google also has a word frequency list and stuff like that. It’s actually a very simple data structure. I’ve got, like, four columns: I’ve got the word. Then I’ve got the key code for that word; it means I take each letter and figure out what that key should be. So if it’s “A,” then that’s “1”, etc. Then I’ve got use count, and I’ve got a frequency count from the dictionary. The use count is for when the user uses the word, so I can refer it compared to other words.
T: Nice, I see. That ends up being relatively simple. You get both the dictionary frequency as well as any slang or any kind of custom word that people may be using through the second column. That makes a lot of sense. I’m always wondering how people build those because you could also use Realm as a graph to store potential combinations.
R: Exactly. I started looking into building a tree structure, but this was much, much simpler. It’s not hard and it performed well.
T: Yeah, if you can get away with doing add-up queries on a table, you might as well do that. Many of us still think better in terms of tables than we do in terms of graphs. I know it’s a big obstacle, mentally, to overcome.
It sounds like you’ve been doing mobile apps for a while, but was this your first native Cocoa application?
T: Was Realm pretty easy to pick up? You said it took just half an hour for this application?
R: Yeah, that was very easy.
T: Overall, how long did it take you to build the application, do you think?
R: It’s tough to say because I took it slow at the start and just worked on it when I had time. I guess I’ve spent maybe 140, 160 hours? About a month’s full-time work.
T: It’s good to hear that Realm was less than one percent of that. That’s the amount of time I like to spend on my database.
Were there particular aspects of Realm that you didn’t care for? Bugs that you faced? Features that you’re missing?
R: No. I think the only point where I was missing something was when I had to sort my query. I had to sort it by two parameters and it was only possible with one. Then, like, two days after, you released the version where you allowed multiple parameters, and that solved it.
T: Yeah, a lot of that kind of stuff was already baked into the underlying core. We just need to expose access to it in Objective-C and Swift. Usually those small things go pretty fast.
R: Besides that, I haven’t really bumped into anything.
T: That’s good to hear. Are there any updates to the application or any other upcoming applications from you that we should look out for?
R: Yeah, the funny thing is, a lot of people from Asia want a manual input version of the keyboard. They don’t want to use the dictionary. I can’t imagine why, but you know where you press each button several times for the right letter?
T: Actually, I saw that being used quite a bit. Is this from China, or what country is it from?
R: Indonesia. Malaysia.
T: Interesting. I know those T9-ish input methods were very popular before current smartphones in China. For a lot of people, I think it’s just mechanics; they can understand the keystroke sequences a lot better than they do even writing whatever character set they have to write.
R: The other thing I’m working on is adding dictionaries — I’ve got a list of languages I’m going to support.
T: You do English and Danish right now and what other language?
R: Spanish. And I hope within a month or two to have German, Dutch, Italian, Swedish, Norwegian, and French ready.
T: Cool, I’m looking forward to the French language so I can start using your keyboard. It’s going to take me back to the good old days of punching numbers on my Nokia.
R: Yeah and the cool thing is that when you switch between languages, it’ll suggest words from the other languages if it doesn’t find one in your active one.
T: I’m looking forward to trying that out. I wish I didn’t have to switch languages all the time because with family members, we tend to speak a mix of English and French together and it’s very cumbersome. It seems very antiquated to have to choose one language to speak in.
Well that sounds very exciting. I’m really looking forward to it. Thanks so much for taking the time to explain it to us, and for using Realm. It really means a lot to us. I hope we’re going to support Xamarin very soon so you can use us from the .NET side too.
R: Yeah, I don’t know where I’m going to continue. I think Swift is going a proper direction, so…
T: Oh yeah? You don’t see yourself going back to Xamarin?
R: No, it was mostly because my friend was using it a lot, so that was his preference and I just tagged along.
I think where it’s having the most impact is actually with Java and with .NET developers, so the people that were already doing mobile development but weren’t doing iOS development or weren’t doing native. And they’re like, “This is an easy enough bridge for me to cross and I didn’t want to deal with brackets of Objective-C anyway, or I was putting off learning the brackets.”
R: That was my excuse as well.
T: Well good luck with the Swift development. A lot of people here love it, and I’m sure it’s going to be a good option to use in the future.
And best of luck on all your projects. We can’t wait to see what’s to come.