How to use emoji icons in an SMS

We can make the presentation more fun by replacing certain character sequences to gif pictures. For example if an incoming SMS message contains the characters: :), a smiley gif animation can be displayed on the screen. Figure 1.


Figure 1.

The following example shows how character sequences can be replaced to gif pictures. Each replacement rule consits of two parts. The first part contains the replacable character sequence e.g.: ':)' the second part contains the replacement text, which can be a reference to en image e.g.: img/smiley.gif.



   subst[0] = ':)'; substto[0] = '<img src=img/smiley.gif>';
   subst[1] = ':-)'; substto[1] = '<img src=img/smiley.gif>';
   subst[2] = ':('; substto[2] = '<img src=img/smileysad.gif>';
   subst[3] = ':-('; substto[3] = '<img src=img/smileysad.gif>';



More information