A typewriter interface to Android devices with the USB accessory capability, utilizes code from Follower's Android background accessory service Can be set to receive incoming SMS messages, as well as Gmail messages using the Javamail library.
The app is mostly the same as Follow's original example, and uses a foreground service that maintains a connection to the accessory, launched by an activity triggered by changes to accessory connected state. The service is set to receive specifc intents, currently generated by seperate SMS and Gmail receivers. An activity maintains the gmail accounts that are set to print messages.
The Arduino sketch is derived from an earlier project that prints SMS texts received by a GSM module through its UART connection, which maps received characters to toggles for a pair of 4051 multiplexers, spoofing keyboard presses on the typewriter.
Portions of this software are copyright (C) 1997-2007 Sun Microsystems, Inc. and licenced under the Common Development and Distrubution Licence (CDDL). The CDDL is availabe at http://glassfish.java.net/public/CDDL+GPL.html and these portions of the software are available at http://code.google.com/p/javamail-android/
Example of how to start a background USB accessory service on Android.
See: http://www.labradoc.com/i/follower/p/android-background-service-usb-accessory