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. Detect which Home screen the user is on?

Hi,

So there are three "screens" that the user can flip between on the
Home screen.  Is there a way to detect which screen they're on or some
way to catch when they've flipped between screens?

Thanks,
Steve
--~--~---------~--~----~------------~-------~--~----~

2. Is there a hook to run code on device shutdown (power off)?

Hello.

Part of the app I'm writing is a Service that does some work. If it
hasn't finished when the user switches the device off I'd like to be
able to save my state to a file and then restart the Service when the
device starts up again.

I can see how to start it up again (receive the ACTION_BOOT_COMPLETED
Intent), but I can't figure out a way to run the saving code on
shutdown. I was expecting my Service's onDestroy() to be called, but
this doesn't seem to be the case.

Thanks.

--
Jon

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

3. How to set the 'singleActivityMode' flag for an activity group's constructor?

4. How to set the 'singleActivityMode' flag for an activity group's constructor?

5. Service processing restrictions on main thread

6. What are the possible way to work on database?

7. Radogroup layout question.