我一直在尝试寻找一些资源,以便为 Android 平台上的可访问性研究项目(APILevel 17)构建 Keylogger Android 应用程序。
应用程序的界面将是一个简单的“EditText”字段,用户使用虚拟屏幕键盘在其中键入[从输入设置中选择所需的键盘后]。
我的目标是为我的应用程序创建一个 Keylog 数据库(使用 SQLite DB,因为我对此很熟悉,但是一个简单的 csv 文件 DB 也可以很好地工作!:)),如下所示:(
插图)
因此,我需要在输入新条目后立即记录每个字符以及时间戳。我一直在尝试使用“ TextWatcher ”类
EditText KeyLogEditText = (EditText) findViewById(R.id.editTextforKeyLog);
TextWatcher KeyLogTextWatcher = new TextWatcher() {
@Override
public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
{ }
@Override
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,int arg3)
{ }
@Override
public void afterTextChanged(Editable arg0) {
// TODO Log the characters in the SQLite DB with a timeStamp etc.
// Here I call my database each time and insert an entry in the database table.
//I am yet to figure out how to find the latest-typed-character by user in the EditText
}
我的问题是:
- 这是实现这个的正确方法吗?
- 我可以获取与时间一起键入的恰好一个字符并将其插入到 SQLite DB 中,以便稍后获取和分析吗?
- 或者onKeyUp方法会更有用吗?[我还没有使用过尝试过的方法,所以如果有人能指出我使用它来构建键盘记录器,如果这更简单的话,那就太好了!]
*提前感谢任何可以以任何方式帮助我的人!
阿迪*