lundi 13 juillet 2015

(Java EE Chat client ) Showing Whatsapp emoji in a String Msg

I am making a software That reads a sqlite database of whatsapp. i am stuck at decoding the smileys in the messages. There are more then 800 smileys in whatsapp and i can code this much to ressolve the issue doing a stringObj.contains("unicode for special Character For emoji") and replacing that unicode with Html Img code for that emoji. Now this is neither the right approach nor it is effcient and also time taking if i code such.

Then i found an angular js library for smileys i am able to decode smileys through it. link: http://ift.tt/1DbyHnD

Now i dont know much of angular js but as much as i understand thr is a filter that acts on textchange of a textbox but the way i am writing all the messages is using custom tag of java at a jsp page. i append a StringBuffer with all the msgs like:

   while(itrMsg.hasNext()){
     m= itrMsg.next();
     if(m.getData() !=null){
                            sb.append("<span style=\"font-family: 'Droid-     Sans-Fallback'; \" > "+m.getData()+"</span>");

                            }
                           }

this is just a snippet of code ,i am decoding everything else like images ,videos ,vcard . now the sb is converted to string and write on jsp page using pageContext.getOut().print(sb.toString());

The problem is i am not able to decode the messages for emojis using that library. i tried a trick putting message in hidden input field but that too doesnt work as filter is called only on text change .

Aucun commentaire:

Enregistrer un commentaire