0

I am trying to send a sms from my html app used on my android dual sim phone. It fills the two field number & body text, but it does not select the default sim & sends sms when link is clicked.

What changes to make to this code to allow it directly to send sms using defult sim when link is clicked.

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    </head>
    <body>

        <header class="bar bar-nav">
          <h1 class="title">SMS Demo</h1>
        </header>

            <a href="sms://09013111111?body=Hello">Link</a>
    </body>
</html>
Katoch
  • 2,709
  • 9
  • 51
  • 84
  • 1
    [http://stackoverflow.com/questions/4338305/android-webview-tel-links-show-web-page-not-found](http://stackoverflow.com/questions/4338305/android-webview-tel-links-show-web-page-not-found) – M D Jan 28 '15 at 11:10
  • means i have to change "sms:" to "tel:" ... ?? – Katoch Jan 28 '15 at 11:15
  • yup and parse body from `href` – M D Jan 28 '15 at 11:15
  • can you add it to your reply how to do this .. ? – Katoch Jan 28 '15 at 11:21
  • means i create an onclick handler for link, an inside this javascript handler i use Android webkit code to send sms ... like this Android webkit code does http://stackoverflow.com/questions/12661625/pass-smsbody-xyz-to-default-browser-in-android-webview – Katoch Jan 28 '15 at 11:39
  • tried this but not working – Katoch Jan 28 '15 at 12:07
  • If i use "tel" instead of "sms" it opens a phone dialer app. What do you mean by parse body ? If it means extract message, then what i have to do ? – Katoch Jan 28 '15 at 13:56
  • Please someone suggest on this. – Katoch Jan 28 '15 at 13:58
  • try as per my answer.. and it's working perfect in my case. – M D Jan 29 '15 at 05:54

0 Answers0