0

i make a project for hearing impaired people ,where two devices are connected via bluetooth , its already working sending and receiving messages but what i want is when i type a text "hi" in a editext and when i click the send button the display would be the picture in a right(girl picture) but if that picture is not available display the second picture in left side(hand sign) , is this possible? can i compare the txt i type to the drawable folder image so that , that particular image will display?... .. enter image description here

 plz share ur idea....

1 Answers1

0
  1. Then you will need the following:
    1. get the text (Hi) before displaying it, by getText
    2. check the availability of the image either you want it to be available in phone 1 or phone 2 by this method
  2. Sure it is possible to send an image via Bluetooth, also you can code it as this example

Also my opinion is to upload the image to the firebase or let it with your application if you need it for much use

Edit : compairing file name with string that you want is like is

boolean fileExists =  new File("path/to/" + name + ".png").isFile();

where name if the chat message you want to compare and surely, that code occurs before the texts/images are displayed to the users

Community
  • 1
  • 1
Dasser Basyouni
  • 3,142
  • 5
  • 26
  • 50
  • your most welcome, and if my opinion is good for you then I will wait for you to accept and vote up, also beware of opinion question and very detailed ones in order to not get vote down form users – Dasser Basyouni Jan 07 '17 at 10:48
  • sir, can i compare the "text" to a image file name in drawble? so that, that particular image will be display? – Mr.abing_da_student Jan 07 '17 at 11:29
  • @Mr.abing_da_student Welcome to Stack Overflow. Please note that the preferred way of saying 'thanks' around here is by up-voting good questions and helpful answers (once you have enough reputation to do so), and by accepting the most helpful answer to any question you ask (which also gives you a small boost to your reputation). Please see the [About] page and also [How do I ask questions here?](http://stackoverflow.com/help/how-to-ask) – Dasser Basyouni Jan 09 '17 at 09:33