4

I am trying to make an app to where I can get custom emojis to be added to the edittext field in the android messenger app and I am having a hard time getting access to that edit text field. Can anybody provide any help with this. I am attaching an image. enter image description here

ronnie173
  • 207
  • 1
  • 3
  • 10
  • did you see http://stackoverflow.com/questions/15352496/how-to-add-image-in-a-textview-text/21250752#21250752 ? – 18446744073709551615 Mar 22 '16 at 15:47
  • well, how would you add your custom images to SMS that are by definition text-only? You could use the unicode emoji, if you could make sure that the recipient's phone supports them. – 18446744073709551615 Mar 22 '16 at 15:55
  • That is not what I am looking for. I know how to do that. I need to know how to get access to that specific textview in the messaging app. – ronnie173 Mar 22 '16 at 15:55
  • Maybe I need to be more clear on what I need. I am looking for a way to inject unicode into that textview without making a whole keyboard app. – ronnie173 Mar 22 '16 at 15:58
  • Then implement some "Emoji Input Method". The user will switch to it, enter a smiley, and switch back to the previous input method. – 18446744073709551615 Mar 22 '16 at 16:04
  • Ok but how do I put text into that specific textview? I tried to override the layout from the messaging app but that is not working. – ronnie173 Mar 22 '16 at 16:31
  • The user chooses your emoji input method, presses a key representing an emoji, the unicode character representing the emoji is inserted into the edit box; the user presses the "previous input method" key, the google keyboard appears instead of your emoji table, but the text, now containing the emoji, is not changed; the user continues to type in the text and finally presses the "send" key. (OTOH I doubt that a recipient whose phone is, say, Nokia 3310 will be able to see the emoji in SMS) – 18446744073709551615 Mar 23 '16 at 08:26

1 Answers1

1

Androids security model prevents all apps but the currently active keyboard from modifying the text input.

You have several options:

  • Register your app as keyboard. Users can switch to and from your keyboard, so it can just include the additional symbols you want to add (and doesn't have to be a full-bleed keyboard).
  • Copy the symbols to the clipboard. Users have to manually paste them.
  • Use Xposed to inject your code (requires root). This works around the Android security model.
F43nd1r
  • 7,690
  • 3
  • 24
  • 62