3

I developed an app that is fun to play with but there are some naughty people who are vandalizing fun of other people by using different type of screen casters and then playing with automated scripts and cheating users.

here is a link to a very famous screen caster. but is there any way to detect it? I think I have read somewhere that I can get tap pressure on accelerometer in android.

please help

AZ_
  • 21,688
  • 25
  • 143
  • 191
  • http://developer.android.com/reference/android/view/MotionEvent.html#getPressure(int) – AZ_ Jun 09 '11 at 13:20
  • you can go to link and there is a method on MotionEvent to detect pressure but haven't tried it. – AZ_ Jun 09 '11 at 13:20
  • http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.html An example related to but not exactly what i want – AZ_ Jun 09 '11 at 13:30

1 Answers1

1

Sample Application

package com.pressure.detection;

import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.TextView;

public class StartActivity extends Activity implements View.OnTouchListener {
    /** Called when the activity is first created. */

 private TextView tvConsole;

    @Override
    public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);
 findViewById(R.id.root_layout).setOnTouchListener(this);

 tvConsole = (TextView)findViewById(R.id.txtConsole);
    }

    @Override
    public boolean onTouch(View view, MotionEvent mEvent) {
    tvConsole.setText("Pressure: "+mEvent.getPressure() );


 System.out.println("Hardware X " + mEvent.getXPrecision()
  * mEvent.getX());
 System.out.println("Hardware Y " + mEvent.getYPrecision()
  * mEvent.getY());
 return super.onTouchEvent(mEvent);
    }

}
AZ_
  • 21,688
  • 25
  • 143
  • 191