Getting Connectbot working on Kindle Fire21 Nov 2011
Ever since getting the Kindle Fire I’ve been dreaming of the day that I can get ConnectBot working. The first hurdle is that this is not available in the Amazon market. Luckily, being under the Apache License they did have code available on the google code site.
After installing the apk file, i started up a test connection. Everything was going well until I got to the part where I enter the server name. The virtual keyboard pops up, but instead of an enter key there is only .com. I recognized this as the keyboard that comes up when you are in the web browser. Unfortunately, unlike the web browser, there is no additional “go” button.
First thing I did was check the issues to see if this has been reported yet. Yes it had, sounds like many people are itching to ssh from their Kindle Fire :-)
So I dutifully tagged the issue and waited for a fix…
After waiting a few days I couldn’t let it sit. I needed to dig in myself and see if i could find anything. Seemed like a relatively easy problem
Once I got all my goodies installed I connected the Kindle Fire, waited for the “connecting USB” to finish…and…NOTHING!
After a little research I learned I first needed to install the Google USB drivers for this device. Went into device manager and found the Kindle device with missing drivers, right-clicked and pointed to the ini file.
At this point I was able to do an adb devices and could verify that my Kindle Fire was detected
At this point I was still pretty much at a loss of where to being. I knew just from playing around with the Kindle Fire that there definitely is a keyboard layout that had an enter key. For some reason this layout was not using it though, it was defaulting to the same one used for entering websites. Having the .com where enter should be is normally not a problem - when the keyboard collapses you can then click on the go button. In this case, however, the keyboard does not allow for that option.
What I finally stumbled upon was, oddly, the default text in the input field “[email protected]:port”. I was able to use this very unique string to search through the code to eventually come upon my first clue. I was lead to a “hint” (literally) in the _
So far success…
Except now I get to the password line and I’m facing a “new” keyboard with the same issue: a .com where and enter should be.
So doing some more searching I use my same method of searching for the text hint, this time Password: Pretty quickly I found this one but it wasn’t quite the same. I was lead to strings.xml which is essentially a “lookup table” for strings. At least now I know that Password: _will be in the code somewhere as _prompt_password. So digging some more I found a corresponding _
Browsing the “layout” folder, I was eventually able to find the file I needed. I found a console_password line in act_console.xml. After adding a android:inputType=”textMultiLine” I was set. I ran the file, sending it to my Fire and met with success this time when connecting to my server. Using the following method I was able to take a screenshot of my victory.
I still have little understanding of why what I changed did what it did, or what repercussions this might have on other Android platforms. I hope this does show, however, that with a little persistence to “scratch an itch” it is pretty easy to use some really basic research and techniques to modify Android source code to meet your needs.
Since this has sparked in interest in me for learning more about Android development. I look forward to learning more about the ins and outs of the platform and how to properly submit and implement patches for bugs like this.
Since this was a quick and dirty hack, I look forward to input on the right way to do this.
Edit 2011-11-22: I forgot to actually describe the problem (lack of Enter key)…