Last night, I hacked together a quick proof-of-concept video to show those who aren’t inclined to read the debug logs the multitouch capabilities of the G1.
Rather than go the proper route, where the multiple finger events would get pushed up from the touchscreen driver and into the java layer where the android applications live and play – another #android member (ionstorm, who also prompted me to look into multitouch in the first place) – suggested just reading the touchscreen event data from a file in the java layer as a quick way to skip over the hard work and demonstrate the possibility to people visually.
I will clean up and post all the necessary source code and instructions for someone to do this on their own phone so that more people can start playing with this later. For now, the brief rundown is that I modified the Synaptics touchscreen driver to have it create a character device at /dev/tsout that it dumps the touchscreen events to. I made /dev/tsout readable by the java layer, and then modified a fingerpaint example program that Google has posted to draw the circles. I have a thread in there that constantly polls that file, and when it sees data there it fires off an update event to the UI thread which scales the x and y position from the coordinate space of the touchscreen driver into the coordinate space of the android canvas and then draws a small circle there. I have it using a different color for the two fingers to make it easier to see.
The performance of this kind of polling is not that great. There are a few quirks to the multitouch aspect of the G1 – but the most important thing that I see is that even though it might not be a perfect multitouch screen capable of detecting millions of discrete touches – just being able to track 2 fingers should give me the only thing I really want… which is the ability to one day pinch to zoom in on the browser and get rid of those silly magnifying glasses.
Shameless plug Hey – if you want to hook a brother up, buy stuff from amazon and use this search box ![]()
Tags: Android, G1, hacking, multitouch, video
November 22nd, 2008 at 9:52 pm
Added this to the frontpage of my site. I hope you keep up the good work so more ppl get interested and start tweaking with it. Also seems you got on engadget with this. I hope that will be enough to spark some attention.
November 22nd, 2008 at 10:25 pm
Hey, this has me really excited. I’ve been raving about the G1 from even before I had it, and the thing has yet to let me down. And this just takes it to a whole new level. Keep up the good work, and I cannot wait until I can try this on my phone.
November 22nd, 2008 at 10:55 pm
Mobile Flash 10 and Multitouch anounced, and the Qualcomm 3d benchmark demo (somewhere between iphone and ps2 graphics if you haven’t seen it yet) all in one week. The last thing G1 haters have to hate on is a tiny free adapter…….Remember the iPhone Gen 1 earphone adapter that you had to buy from belkin for 15 dollars?
November 23rd, 2008 at 12:10 am
This is great stuff Brian. We’ve added this to our blog as we know how many G1 owners have been waiting for something like this to happen. Let us know when you release the code / guide that lets others figure out how to do this.
You may have just created a whole new G1 modding niche
November 23rd, 2008 at 10:08 am
that’s dope.. can’t wait for the final result..
November 30th, 2008 at 4:02 pm
Great!
December 25th, 2008 at 10:47 pm
Какие положительные результаты
January 11th, 2009 at 5:38 am
Hey Ryan,
Thanks for your work on this, it inspired me to look deeper into the multitouch problem on the G1, and I figured out a way to implement multitouch that doesn’t require modifying the kernel at all. In fact it turns out that the Synaptics driver already passes the multitouch events all the way up to the Java stack, and then they get dropped there. The code that you removed the comments from was just debug code, but if you read further down in the driver, you’ll see that events for both touchpoints are actually generated. I got multitouch working through the normal event system, without re-plumbing it or changing the API, by hacking multitouch events to work in a way that is backwards-compatible with single-touch applications. Video and full source are here:
http://lukehutch.wordpress.com/android-stuff/
January 26th, 2009 at 9:14 am
awesome, im glade I got ppl to look into this further
January 30th, 2009 at 12:34 am
Дискутировать на эту тему можно бесконечно, поэтому просто поблагодарю автора. Спасибо!
April 12th, 2009 at 1:01 pm
dude, will the multi-touch hack interfere with the cupcake update?