title: Sending text via Wi-Fi when Wi-Fi is ON and received text as Normal message application
body: <p>I am making a Sms application in which i want to send text messages over Wi-Fi.
  In other words if internet connection is ON then the message will be send over 
  Wi-Fi and if there is no internet then the message will be send via app and carrier charges will be applied. I just want to know that is it possible in android? I heard that this can be done in Iphone through iMessage but is it possible to do that in android?
  I am thinking that If Internet is ON then the message should be send to server and there is some algorithm on Server side that receive the message and send it to the person with the sender contact number and message.
  Help me in this way what to do and how to do, any directions will be appreciated. Thanks</p>