我开发了一个有趣的应用程序,但是有一些不良分子正在使用不同类型的屏幕投影工具,并使用自动脚本来破坏其他用户的乐趣并欺骗用户。
这里是一个链接到一个非常著名的屏幕投影工具。但是有没有办法检测它?我想我在某个地方读到过可以在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);
}
}