Multitouch API question

by Rafa艂 Grzybowski » Sat, 01 May 2010 18:37:34 GMT


Sponsored Links
 I'm trying to detect fingers location on the screen within
onTouchListener. The location looks fine when only one finger is "on
touch". Touching with the other one causes somehow my first finger
location to be corrupted, shifted by some value. Below is an example
of the location log ([x, y]):

05-01 12:26:47.410: VERBOSE/TouchTest(8204): [58, 66]
05-01 12:26:47.960: VERBOSE/TouchTest(8204): [58, 67]
05-01 12:26:48.061: VERBOSE/TouchTest(8204): [58, 68]
05-01 12:26:48.070: VERBOSE/TouchTest(8204): [58, 69]
05-01 12:26:48.090: VERBOSE/TouchTest(8204): [58, 72] [392, 72]
05-01 12:26:48.100: VERBOSE/TouchTest(8204): [58, 73] [391, 74]
05-01 12:26:48.110: VERBOSE/TouchTest(8204): [58, 74] [391, 75]
05-01 12:26:48.121: VERBOSE/TouchTest(8204): [58, 75] [391, 76]
05-01 12:26:48.143: VERBOSE/TouchTest(8204): [58, 76] [391, 77]
05-01 12:26:48.170: VERBOSE/TouchTest(8204): [58, 77] [392, 78]
05-01 12:26:48.190: VERBOSE/TouchTest(8204): [58, 78] [392, 79]
05-01 12:26:48.230: VERBOSE/TouchTest(8204): [58, 79] [392, 80]
05-01 12:26:48.260: VERBOSE/TouchTest(8204): [58, 80] [392, 81]
05-01 12:26:48.320: VERBOSE/TouchTest(8204): [58, 81] [392, 82]
05-01 12:26:48.410: VERBOSE/TouchTest(8204): [58, 82] [393, 82]
05-01 12:26:48.510: VERBOSE/TouchTest(8204): [58, 82] [393, 81]
05-01 12:26:48.520: VERBOSE/TouchTest(8204): [58, 82] [393, 78]
05-01 12:26:48.531: VERBOSE/TouchTest(8204): [58, 77] [394, 73]
05-01 12:26:48.550: VERBOSE/TouchTest(8204): [58, 69] [394, 73]
05-01 12:26:48.570: VERBOSE/TouchTest(8204): [58, 68]
05-01 12:26:48.592: VERBOSE/TouchTest(8204): [58, 67]
05-01 12:26:48.730: VERBOSE/TouchTest(8204): [58, 66]
05-01 12:26:49.580: VERBOSE/TouchTest(8204): [58, 67]
05-01 12:26:49.640: VERBOSE/TouchTest(8204): [58, 68]

The code that creates the log above is:

StringBuilder message = new StringBuilder();

for (int i = 0; i < event.getPointerCount(); i++) {
  float viewX = event.getX(i);
  float viewY = event.getY(i);

  if (i != 0)
    message.append (' ');

  message.append ('[');
  message.append((int)viewX);
  message.append (", ");
  message.append((int)viewY);
  message.append (']');
}

Log.v (
  "TouchTest",
  message.toString());

And I'm having problems with creating a view to control some car.
There are four areas on the image to choose left/right/forward/
backward and when only one area is touched it works great. Touching
another one causes misplaced X,Y coordinates for both of it. When I
release the first area suddenly second area is detected as being
touched. I've created dummy event.getXY(...) log to show that the
problem arises from MotionEvent data (or my understanding of it
contents) not area hit detection.

Thank you.

--



Multitouch API question

by Yahel » Sat, 01 May 2010 20:12:58 GMT


 Hi,

You should try to search the group for "multitouch broken" and you'll
find three or four threads around the fact that on Android, multitouch
is unusable.

Seems to be because of the cheap hardware used in htc and motorola
phones, not the Android SDK.

Good luck.

Yahel

--


Sponsored Links


Multitouch API question

by Rafa艂 Grzybowski » Tue, 04 May 2010 03:04:08 GMT


 Thank you.



>



Multitouch API question

by Robert Green » Tue, 04 May 2010 04:15:33 GMT


 FYI - Multitouch is not unusable.  It just has limitations you should
be aware of.  The new phones (Incredible and Evo) are much better with
it.  If you want to see a working multitouch example used in a game, I
just launched a game called Antigen the other day.  If you are running
2.0+, you'll get two buttons on the right side of the screen.  You can
tap them while holding down the joystick on the left.  It all works, I
just had to position them funny to keep from having the near-axis
issues on the synaptics screen.




> >



Other Threads

1. ListView not touchable in my Activity - A clue...not the solution though..

Thanks for answering...

I ended descontructing the whole Activity until I came across what
seems to be the cause of the problem.

When creating the SimpleCursorAdapter I use: R.layout.row which is a
layout that I created.
When I use one of android's, for instance:
android.R.layout.simple_list_item_1, it works but it does not show
what I need on screen.

If anybody can help... I'd appreciate it.  Thanks!

You don't see any itemClickListener because I post part of the
code...this is what I missed.

@Override
    protected void onListItemClick(ListView l, View v, int position,
long id){
     super.onListItemClick(l, v, position, id);

     Cursor c = (Cursor) this.getListAdapter().getItem(position);

     this.var1=c.getString(1);
     this.var2=c.getString(2);
     this.var3=c.getString(3);
     this.var4=c.getString(4);

     Intent nextActivity = new Intent(Activity_CardList.this,
Activity_ViewCard.class);
     nextActivity.putExtra("var1", var1);
     startActivity(nextActivity);
    }



--~--~---------~--~----~------------~-------~--~----~

2. Is it just me or do you have to press one button too many to switch off the G1?

I expect you're referring to the confirmation dialog just before the device
actually powers off.

I personally don't mind it, I remember my old u600 had a {*filter*} habit of
cancelling a new message without confirmation just because I pressed the
delete button a second longer than I meant to. Similar thing might occur
when trying to set silent mode on the G1 without the shutdown confirmation.

Would be nice to have a "don't ask me again" checkbox on dialogs like this
so you can customise this behaviour, although then you have the problem of
how to turn them back on...

On Apr 11, 2009 1:15 AM, "admin.androidsl...@googlemail.com" <




As the subject says

--~--~---------~--~----~------------~-------~--~----~

3. What happened to the HOME button in cupcake

4. showing graph in Application

5. regarding audio chat on android

6. Porting on msm7225

7. How to add a EFI bootloader to android