0

I'm currently working on android service. One of its task is to read the input data entered by user (and also modify it) .

The only possible way that till now, I've figured out is to make a custom keyboard and write methods in that custom keyboard. I don't want this .

Is their any other method for it?

Thanks

Edit: I need this to work across multiple applications. So I don't think TextWatcher can help here.

Abhi
  • 3
  • 3
  • AFAIK keyboard is being handeled by OS...not sure if it can be observed – Dumbo Jun 09 '14 at 22:04
  • I don't understand what you mean by "service" in this context. Is this when typing into an `EditText`? If so, a `TextWatcher` might be an easier alternative. If you're trying to modify input to other applications, then it's different. – matiash Jun 09 '14 at 23:18
  • @matiash I want to read and modify input across multiple applications. – Abhi Jun 09 '14 at 23:25
  • No. That would be a pretty dramatic security risk to be able to read other apps' keyboard input like that. – DeeV Jun 09 '14 at 23:33

1 Answers1

0

It can surely be observed by using an Accessibilityservice.

Check

http://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html

specially typeViewTextChanged and typeWindowContentChanged

This will not completly check all key hooks but you can check for changedtext in the focused window. With a little workaround you will be able to do what you want to do.

Emanuel
  • 8,027
  • 2
  • 37
  • 56