Get Multi-Touch Zooming Support on Your G1 Today

Even though the Androig G1 phone has touch screen capabilities, it doesn’t support multithouch out-of-the-box. Luke Hutchison posted a blog entry over the weekend detailing how to get multitouch working on your G1, as well as a few demo applications he wrote. He also posted a video showing multitouch working on the G1.

Hutchison made the necessary changes to the Android software stack, and also wrote a number of demo applications to show off the multitouch capabilities of Android and the G1. Note, though, that this is a proof-of-concept, and that performance isn’t up-to-speed due to the lack of OpenGL acceleration and the lack of kinetic zooming (should be “trivial to implement”, he adds). Hutchison also explains that the current API only implements step-wise zooming, taking the fluency out of the animations.

The implementation is completely forwards and backwards compatible; you can implement extra multitouch features into your applications, without breaking them for unpatched G1s:

The technical details: currently there is no way for an app to detect whether or not the phone has this multi-touch patch until the user initiates a multi-touch gesture, but at that point the size field of a MotionEvent in the onTouchEvent() method will have a value greater than 1.0. You can read multi-touch information by parsing this value, as shown in MultiTouchController.java in the demo apps below. Unpatched G1s will never generate a size value greater than 1.0, so you know that a size value less than or equal to 1.0 is a single-touch event regardless of whether or not the phone has been patched.

The remainder of the blog entry deals with how to patch your G1, which obviously comes down to flashing it with a community firmware. According to Hutchison, it is unlikely that multitouch support will ever make it to the G1 officially, despite the fact that there is support for it in the Android kernel. “In my opinion, it is unlikely that the G1 will ever get official support for multi-touch from Google in its lifetime, because it was never designed as a multi-touch device, and there are some limitations to multi-touch on this device,” he explains, “Google will also not accept upstream this specific workaround solution to hack multi-touch onto the G1, understanably so, as no multi-touch API has yet been proposed or agreed on. See this thread for more information.”

8 Comments

  1. 2009-01-26 9:19 pm
    • 2009-01-27 12:00 am
      • 2009-01-27 1:00 am
        • 2009-01-28 10:12 pm
    • 2009-01-28 3:08 pm
      • 2009-01-28 4:15 pm
  2. 2009-01-28 12:21 am
    • 2009-01-28 4:18 pm