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. Mod: Thanks to Boss Iskandar gilaoriginal @ Surabaya

iya plasa marina,


salam,



> 

2. Dibutuhkan Programmer Android

Punten mau numpang buka lowongan singkat...

Dicari *programmer Android* untuk mengerjakan project *client-server* bersama
GITS Indonesia (*developer* aplikasi Bahasa Dictionary, Chickenstrip, dan
Ask Indro).

*Syarat:*
- Pernah membuat aplikasi Android
- Mengerti Java
- Punya device Android :D
- Berdomisili di Bandung

Kirimkan cv dan *list *aplikasi Android yang pernah dibuat ke
i...@gits.co.id. Terima kasih.
-- 
Ibnu Sina
http://android.gits.co.id
GITS Indonesia for Android

-- 
"Indonesian Android Community [id-android]" 

3. onHandleIntent(Intent) method does not get called

4. How to on Gps in emulator

5. Background apps (Instant Messaging) being killed without user notification

6. How to Draw route on Google map? not to use DrawPath

7. problems about add-ons and sdk