如何检测屏幕脚轮机器人,检测自来水pressure [英] how to detect screen casters android, detect tap pressure

查看:145
本文介绍了如何检测屏幕脚轮机器人,检测自来水pressure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个应用程序,它是好玩,但也有一些调皮的人谁是通过使用不同类型的屏幕脚轮,然后玩自动化脚本和欺骗用户捣毁别人的乐趣。

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.

这里是以一个非常著名的画面施法者的链接。但有什么办法来检测呢?我想我已经读的地方,我可以得到自来水pressure加速度计的机器人。

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.

请帮忙

推荐答案

示例应用程序

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);
    }

}

这篇关于如何检测屏幕脚轮机器人,检测自来水pressure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆