Friday, November 6, 2009

Puzzle Pal: Sudoku Solver UI fixes

I did some fine tuning to the Sudoku Solver. The input grid is a subclass of EditText, and I override the onTouchEvent method to select a cell. After that I used to return false. I changed it to return super.onTouchEvent so that it brings up the soft keyboard when you tap anywhere on the grid.

I also changed the way I handle key events. Before I used getDisplayLabel() to determine the letter typed, which is incorrect since it only reflect the label on the keyboard, ignore key combinations. Now I use getNumber(), which confusingly also returns characters that are not numbers.

Wednesday, September 23, 2009

Puzzle Pal update: now with decoders!

I just uploaded Puzzle Pal v1.1.0 to Android Market. It has a new Decoders menu with three decoders: Braille, Morse Code and Semaphore.

All of the decoders have a buffered area to show decoded output, so you can just keep adding new symbols and see what it spells.


Saturday, September 5, 2009

Customize the soft keyboard

When you type something in Puzzle Pal, it is usually just a sequence of characters, not a valid word. The Android soft keyboard has auto-correct as default, which can be a bit annoying. Fortunately, you can customize the soft keyboard by specifying the input type of the TextView.

When I am expecting text, I use this:

textView.setInputType(
  InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);

Phone spell only accept digits, so I use this instead:

textView.setInputType(InputType.TYPE_CLASS_PHONE);

setInputType tells the system what you expect as your input. I picked visible password for text because that turns off auto correction. For phone spell, well, it is much more intuitive to offer a phone pad, isn't it?

Thursday, August 27, 2009

Puzzle Pal launched

It all started in New Zealand.

I have always wanted to learn to do cryptic crosswords, but in USA only the hard-core cruciverbalists play cryptics, so there isn't a lot of beginner material. Imagine my joy when I bought my first cryptic crossword booklet in a supermarket in Te Anau! I happily went through the puzzles, but as a newbie I often got frustrated when I knew what do to, be it anagrams, hidden answers and what have you, but was stuck anyway because I could not come up with the word. Internet was not available since I was touring the country, so I really wanted an offline app on my phone.

I came home and started writing an app for pattern matching and anagram, which are great for cryptic crosswords. After I built the wordlist, I realized that I could do more with it, so I threw in different modes like phone spell and caesar cipher. While I was at it, I added a sudoku solver too.

I was going to keep this as a little tool for myself, but once my friends saw it, they wanted a copy as well. I polished the app a bit, and decided to put it on the Android Market for all to enjoy. Hope you like it too.