Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1050301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:45:01+00:00 2026-05-16T16:45:01+00:00

I have a small test app on Android that is meant to test tracking

  • 0

I have a small test app on Android that is meant to test tracking multitouch input, but I am only ever getting two touches at the same time on my Evo. Does anyone know if this is a limitation to Android or the hardware?

By the way, here’s my test class so you can try it out yourself.

import java.util.HashMap;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.view.MotionEvent;
import android.view.View;

public class PressureView extends View
{
    private HashMap<Integer, Spot> mSpots = new HashMap<Integer, Spot>();
    private final int[] mColors;
    private final Paint mPaint;

    public PressureView(Context context)
    {
        super(context);
        mPaint = new Paint();
        mPaint.setStyle(Style.FILL);
        mColors = new int[]{Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW, Color.MAGENTA};
    }

    @Override
    protected void onDraw(Canvas canvas)
    {
        super.onDraw(canvas);

        canvas.drawColor(Color.WHITE);
        for(int id : mSpots.keySet())
        {
            Spot spot = mSpots.get(id);
            mPaint.setColor(spot.Color);
            canvas.drawCircle(spot.X, spot.Y, spot.Pressure*500, mPaint);
        }
    }

    @Override
    public boolean onTouchEvent(MotionEvent event)
    {
        System.out.println("************************** " + event.getPointerCount() + " Pointers");

        for(int i = 0; i < event.getPointerCount(); i++)
        {
            int id = event.getPointerId(i);

            Spot spot = null;
            if(mSpots.containsKey(id))
            {
                spot = mSpots.get(id);
            }
            else
            {
                spot = new Spot();
                spot.Color = mColors[mSpots.size()];
            }

            if(event.getAction() == MotionEvent.ACTION_UP) spot.Pressure = 0;
            else spot.Pressure = event.getPressure(id);

            spot.X = event.getX(id);
            spot.Y = event.getY(id);

            mSpots.put(id, spot);
        }

        invalidate();

        return true;
    }

    private class Spot
    {
        public float X, Y, Pressure;
        public int Color;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:45:02+00:00Added an answer on May 16, 2026 at 4:45 pm

    It seems that currently all HTC devices only can 2 finger multi-touch, but the Android SDK supports more fingers. E.g. the Galaxy S i9000 has support for more http://www.youtube.com/watch?v=KRCDRXYJBCY .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small test app that parses a few RSS feeds. It all
I have small test app: Socket socket = new Socket(jeck.ru, 80); PrintWriter pw =
I have a small Java test app in Netbeans where the main() class reads
i just started building a small test app to help me learn MVC. i
I'm new to rails and building a small test app on rails3 (beta4). I
I have two types of custom handhelds which are similar, but slightly different, each
0xE8000003A Error: I have developed AppOne for several weeks. I can debug on both
Subversion 1.6 Ubuntu 10.4 I have a project with the following repository layout. proj/trunk
I have problem concerning python packages and testing. I'm writing an application using wx
We are trying to use Test Complete 7 to test an application compiled in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.