For now your TextWatcher is not binded to EditText
You should use addTextChangedListener(TextWatcher yourWatcher)
on your EditText.
Here is my example:
smsET.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
Log.d(TAG, "onTextChanged start :"+start +" end :"+count);}
public void beforeTextChanged(CharSequence s, int start, int count,int after) {
Log.d(TAG, "beforeTextChanged start :"+start +" after :"+after);
}
public void afterTextChanged(Editable s) {
int lastPosition = s.length()-1;
char lastChar = s.charAt(lastPosition);
Log.d(TAG, "afterTextChange last char"+lastChar );
}
});
In your code it should be like this :
KeyLogEditText.addTextChangeListener(KeyLogTextWatcher );
Each of method included in this Watcher is triggerd by entering every single sign from keyboard. Since you get posistion after input you can easly get character that was entered
To store data you mentioned, SharedPreferences will be faster than DB. (Many writes to DB) If your target is at least api 11 you can simply use StringSet Editor.putStringSet if your target is lower it is also possible, some example : http://androidcodemonkey.blogspot.com/2011/07/store-and-get-object-in-android-shared.html
.