Monday, July 13, 2015

Cecilia's Drawing Toy: Updated for Little Hands

You learn a lot about proper software design by actually watching users. This is a well-known fact, but sometimes a reminder is helpful.

Cecilia was in town for several weeks, so I got a chance to watch her playing with her drawing toy. I noticed that she preferred to hold the phone tightly with one thumb, which really threw off the motion tracking.

A few changes later, I added support for multiple-touch operations. If little hands need to grab the screen in two places, that's not a problem!

It's also good for finger-painting. :)


As always, the updated version is available on the Play Store if you're not in the mood to mess around with compiling your own.

Tuesday, January 6, 2015

Intro video for Nausicaa

I completed an intro video for Nausicaa, my Google Glass telemetry view for Kerbal Space Program (using the Telemachus plugin). Check it out!


Sunday, November 2, 2014

Halloween Costume: Jebediah Kerman

So, you might say I've been playing a lot of Kerbal Space Program recently. So with Halloween rolling around, I thought to myself: Why not make a costume of the web's favorite fictional space explorer?


Sunday, August 10, 2014

Cecilia's Drawing Toy: now with eraser

Made a few tweaks to Cecilia's Drawing Toy today:

  • I learned that the gravity sensor is actually a lot more rare than I'd anticipated, so I tuned the code to use but not rely on either the gravity or accelerometer sensors (when they're missing, you don't get "hold upside down and shake to erase," but the toy still works). Toy is now usable on an additional 4,000-some-odd devices.
  • Since users without shake-to-erase would be lacking an erase option, I added a good old-fashioned eraser tool. Additional tools (paint bucket, undo, multiple layers with arithmetic overlay masking transform blending using Porter-Duff algorithms) to be added in subsequent releases, on an undisclosed, indeterminate, and really quite imaginary schedule.


Cecilia and her family are actually in town, so I got a chance to see her try it out. She did good; that's a quality "F" in there! Not bad for a 1-year-old.

Monday, July 28, 2014

Tablets in the wild

You learn some interesting things as an Android developer.

Periodically, I check up on my crash reports to verify that there isn't anything crazy going on with my app. Today, I was sad to see that I'm getting crashes on machines with no gravity sensor—my mistake; need to push a fix.



The list of machines, though, was interesting. One of the devices that showed up was a "nuclear-86v2g", which I had not heard of before. Some Googling turned up the details: it's apparently a not-well-known (in the States, anyway) Chinese tablet by the name of "Amaway," which runs Android 4.0. Sadly, it appears to lack a gyroscope sensor and so won't run Cece's toy, but it's interesting to see how far a simple program can travel on the web.
Cute little thing (image source)

Sunday, July 13, 2014

My graphical ace-in-the-hole: ColorHexa

Things are afoot, but nothing I'm going to talk about right now. So I'm going to talk about ColorHexa instead.


Sunday, June 29, 2014

Cecilia's Drawing Toy

Image from the game: a smiling sun on the right, and a set of color markers on the left.
My sister- and brother-in-law recently celebrated the birthday of their second daughter, Cecilia. She's not quite old enough to care about the touchscreen devices yet, but I figured I'd get a head-start on this one. So here you go: Cecilia's Drawing Toy.

Much like its "sister" software, Frances's Tracing Game, this one is available for download on the Play Store, or you can poke through the source code on GitHub. You can select a color and draw with your finger, then to erase, hold the whole device upside-down and shake it (like another drawing toy you might have heard of ;) ).


I was able to re-use quite a bit of the source code from Frances's Tracing Game for this one, so the build cycle wasn't quite as long. I feel like I'm pretty much getting the hang of the drawing toolkit for Android; this one should play more nicely than the first versions of Frances's Tracing Game did with different screen sizes and form factors. It's missing a way to save images right now (but you can do so with the "screenshot" feature on most phones).

If you thumb through the source code, you'll find some goodies. It's all licensed under Apache, so feel free to grab any pieces and use them in your own projects (with proper sub-licensing and attribution). In particular, these modules are broken out and intended for re-use:


  • RandomSound: Give it a collection of sound resources and it will select, load, and play random ones continuously. Useful for footsteps, etc. There's some lag between the end of one and the beginning of the next that I should clean up.
  • OscillationSensor: Detects back-and-forth jerks in a linear direction. Useful for detecting device shaking.
  • FaceDownSensor: Detects when the device's screen is angled towards the floor, and sets a simple flag that the render thread can check.
As always, I dug up some likes and dislikes as I put this together.

Things I Liked

  1. Code re-use worked as intended. :) Both the initial layout of the project and the push to the Play Store were a lot simpler with templates ready to go.
  2. Instead of wrestling with Windows to build this one, I put together a development environment in a virtual machine running Debian Linux (with my favorite tool suite---emacs, git, and the command-line SDK---installed from packages and ready to go). It turned out to be a smoother development environment, to my mind; I spent less time thrashing about with the command line and more time writing code.
  3. Build-test cycle on a connected Android device is super-simple. I just kept "adb logcat" running in one console to spot-check installation failures, had "ant debug && ant installd" as my compilation command, and off I went.

Issues

  1. The timestamp on accelerometer events is extremely wonky. As I discussed previously, I eventually ignored them and tagged every incoming sensor event with a datetime as the sensor thread got ahold of it; not accurate, but sufficient for OscillationSensor.
  2. The Play Store makes you (hypothetically) put together a lot of images and material for a proper launch. Screenshots for phone, for tablet, for 10" tablet, promo image, icon, big super-awesome icon if you end up in the "Featured" section... It'd be cool if at least some of that could be dynamically generated. I spent more time preparing and uploading PNGs than I did writing RandomSound.

Future Ideas

This'll be a fun one to keep updating, but really, the list of new things is small on this one:

  • save the current image when the app quits or is killed
  • allow for mixing of your own marker colors
  • eraser (besides holding upside down and shaking)
  • undo

Enjoy!

If you have a little one in your life, feel free to grab the toy and let me know if they like it! Feedback is welcome on the game's Play Store page, here, or on Plus. Go make something cute. ;)