{"id":472,"date":"2013-01-11T23:13:23","date_gmt":"2013-01-11T22:13:23","guid":{"rendered":"http:\/\/blog.ansuz.nl\/?p=472"},"modified":"2014-01-15T13:11:06","modified_gmt":"2014-01-15T12:11:06","slug":"sending-sms","status":"publish","type":"post","link":"http:\/\/blog.ansuz.nl\/index.php\/2013\/01\/11\/sending-sms\/","title":{"rendered":"Sending SMS"},"content":{"rendered":"<p>Being able to send an SMS to a device can come in really handy from time to time. Below are two methods for sending text to a device using SMS. The first is to send to a hardware device, the second to send to a virtual device on an emulator.<\/p>\n<p><strong>Hardware device<\/strong><\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">bash<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"bash\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">&gt;<\/span> adb shell<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">$ am start <span style=\"color: #660033\">-a<\/span> android.intent.action.SENDTO <span style=\"color: #660033\">-d<\/span> sms:01123123123 <span style=\"color: #660033\">--es<\/span> sms_body <span style=\"color: #ff0000\">&quot;Text to send&quot;<\/span> <span style=\"color: #660033\">--ez<\/span> exit_on_sent <span style=\"color: #c20cb9;font-weight: bold\">true<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">$ input keyevent <span style=\"color: #000000\">22<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">$ input keyevent <span style=\"color: #000000\">66<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>For more info, see &#8220;<a title=\"How do I send an SMS from a shell?\" href=\"http:\/\/stackoverflow.com\/questions\/4043490\/how-do-i-send-an-sms-from-a-shell\" target=\"_blank\">How do I send an SMS from a shell?<\/a>&#8221; on Stackoverflow.<\/p>\n<p><strong>Emulator<\/strong><\/p>\n<ol>\n<li>Open the DDMS perspective in Eclipse.<\/li>\n<li>Under &#8220;Telephony Actions&#8221; select &#8220;SMS&#8221;.<\/li>\n<li>Fill out &#8220;Incoming number&#8221; and &#8220;Message&#8221;.<\/li>\n<li>Hit &#8220;Send&#8221;<\/li>\n<\/ol>\n<p>For more info, see &#8220;<a title=\"Using DDMS\" href=\"http:\/\/developer.android.com\/tools\/debugging\/ddms.html#ops-location\" target=\"_blank\">Using DDMS<\/a>&#8221; on the Android developers site.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Being able to send an SMS to a device can come in really handy from time to time. Below are two methods for sending text to a device using SMS. The first is to send to a hardware device, the &hellip; <a href=\"http:\/\/blog.ansuz.nl\/index.php\/2013\/01\/11\/sending-sms\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[112],"tags":[],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/comments?post=472"}],"version-history":[{"count":8,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":542,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/472\/revisions\/542"}],"wp:attachment":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/tags?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}