How does Multitouch works??

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How does Multitouch works??

Postby lokidil » Fri Aug 14, 2009 6:40 am

I m using different view each view has its own picture. Now the problem i need to sense the multi-touch different view!! Here is the code so that its easy to understand my problem
Code: Select all
FrameLayout main = (FrameLayout) findViewById(;
        main.addView(new MColor(this, new Rect(0,0,320,107), Color.RED));
        main.addView(new MColor(this, new Rect(0,107,320,214), Color.BLUE));
        main.addView(new MColor(this, new Rect(0,214,320,321), Color.GREEN));
        main.addView(new MColor(this, new Rect(0,321,320,428), Color.YELLOW));
        main.setOnTouchListener(new View.OnTouchListener() {
         public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub
            //float x = event.getX();
              int y = (int) event.getY();
                  case 0:
                     Log.e("Selected ","Red");
                  case 1:
                     Log.e("Selected ","Blue");
                  case 2:
                     Log.e("Selected ","Green");
                  case 3:
                     Log.e("Selected ","Yellow");
            return true;

When i touch the views simultaneously the first view get touched only detected.How to synchronous the touch plz help me!!!
Junior Developer
Junior Developer
Posts: 13
Joined: Mon Aug 10, 2009 6:08 am


Postby padde » Fri Aug 14, 2009 11:16 am

Afaik android does not support multitouch.. it has the hardware to do so.. but its disabled in the system
because apple holds the patent for it.
I'm sure you can find Android versions out there with multitouch feature enabled.
But i think even if someone enabled multi touch in the system the API to use it with the SDK would still be
Maybe a future official release will support multi touch and give us access to it via sdk.

--- News ---
i googled a bit and found this article
Its in german but for those not able to speek german. A short one sentence roundup:

Android 2.0 (Eclair) brings multitouch to all android smartphones.

I thought android 2.0 is Donut but never mind.. i hope 2.0 brings multitouch to us all :)
Master Developer
Master Developer
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby lokidil » Fri Aug 14, 2009 11:53 am

Thank U so much padde,
Is there any other methods to hack those things!!!
Junior Developer
Junior Developer
Posts: 13
Joined: Mon Aug 10, 2009 6:08 am

Postby mangaluve » Fri Aug 14, 2009 12:31 pm

You _can_ get multi touch in Android if you build the platform by yourself. The touch screen on the G1 has support for multi touch, I believe, so it's possible to try it, but people in general won't be able to use it.
Experienced Developer
Experienced Developer
Posts: 82
Joined: Mon Mar 23, 2009 8:59 pm

Postby Emmanuel7 » Fri Aug 14, 2009 7:52 pm

Two different points :

For the software :
Multi touch is not supported by current version of Android, so you can't deal with it.
You can modify the OS code to handle it, but your application won't be compatible with any real phone.
I think they are some hacked ROMs with 'some' multi touch support, but once again, only those with this version will be able to use it.

For the hardware :
As far as I know, only the HTC Hero can do real multi touch in hardware.
There have been some talks about multi touch on G1/G2( dream/magic ), but it is not by any way real multi touch !!
You just have the X and Y coordinates of all the touches, but you don't know the coordinates of a particular impact.

For instance :
You press the 10, 20 and the 20, 10 points.
The hardware can tell you there were some touches on X on coordinates 10 and 20 and on Y coordinates 10 and 20.
So you can't find if the touched points were
10,20 and 20, 10
10, 10 and 20, 20

For certains application it can be used, but it is definitively not real multi touch !

Hope it clarifies things,
Senior Developer
Senior Developer
Posts: 164
Joined: Fri Dec 12, 2008 2:17 am
Location: Paris


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 1 guest