perumal316
perumal316

Reputation: 1169

keyboard log for reference

I want to write an application that will log down whatever I type using the Android keyboard.

The purpose is to have a backup of all the keyboard entries.

Is it possible?

Regards.

Upvotes: 0

Views: 272

Answers (1)

Poojan
Poojan

Reputation: 3332

Yes it is possible. You can use Log.v(app_name, message) in the method 'onKeyDown', which is called when a key is pressed. Something like this can be done.

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if ((keyCode == KeyEvent.KEYCODE_BACK)) {
        Log.v(app_name, "Back button pressed");
    }
    return super.onKeyDown(keyCode, event);
}

Upvotes: 1

Related Questions