I can't seem to get any consistent results trying to use the
multitouch on my droid.

Even if i put both fingers down I don't get two pointers, If I put one
down, then the other, it still says one pointer. Then if I lift the
first one, and put it down again, then it says two.

Multitouch API SUCKS

My test code:


View.OnTouchListener onTouchMain = new View.OnTouchListener() {

                @Override
                public boolean onTouch(View v, MotionEvent event) {
                        // TODO Auto-generated method stub

                        Integer tempint = new Integer(event.getPointerCount());
                        int action = event.getAction();

                        if (action == MotionEvent.ACTION_DOWN)
                        {

                                //statustext.setText("touched with " + 
tempint.toString() +
"pointers");
                                Log.i("POINTER", "There are " + 
tempint.toString() + " pointers");

                        }

                        if (action == MotionEvent.ACTION_POINTER_DOWN)
                        {


                                Log.i("POINTER", "There are " + 
tempint.toString() + " pointers");
                        }

                        if (action == MotionEvent.ACTION_UP)
                        {
                                statustext.setText("ready");

                        }


                        return true;
                }
        };



-niko

On Dec 8 2009, 9:45 pm, Peter Kirn <peterk...@gmail.com> wrote:
> Possibly worth adding -- while trying to analyze size is unwise with
> touchscreens as Dianne rightfully says, what some iPhone platform
> developers are doing is to determine pressure by analyzing the
> microphone input. This will work with Android, too (it's an old trick,
> pre-dating iPhone), especially Android phones. It's a bit tricky to
> code, and obviously this is more of an expressive thing than it is
> something you'd consider as fundamental to UI design, but I've tried
> some experiments that were pretty effective.
>
> Peter
>
> On Dec 1, 4:34 pm, Dianne Hackborn <hack...@android.com> wrote:
>
> > On Tue, Dec 1, 2009 at 1:25 PM, patrick <patrick.boul...@gmail.com> wrote:
> > > ->for the pressure, when i use 2 fingers, the size 'detected' is
> > > sometimes suddenly enormous.
>
> > That is exactly how the G1 and myTouch screen works -- when two fingers are
> > down, the size is essentially seeing them as a large touch area.
>
> > So please keep in mind: even the x and y location during multi-touch can be
> > somewhat inaccurate in some various ways, that depend on the exact screen
> > hardware.  The size and pressure are already not so accurate and vary in
> > their response with just one finger; for two or more fingers you will see
> > widely different behavior across different screens.
>
> > As I have said many times before: size and pressure are really not too
> > useful for driving the UI.  This goes even more so for multi-touch.  You
> > just need to accept that.
>
> > > about the finger limit, do you know if it will be the same for the htc
> > > hero when it will receive the 2.1 firmware update?
>
> > As I said, the framework has no finger limit.  I don't know what screen htc
> > uses on whatever devices the ship, so I can't answer this question.  Sorry.
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to