/ Published in: Java
This example of Java SMS Sample Code utilizes a clichéd Java Object API.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Android SMS API integration code //Your application url //Your User Id //Your password //Multiple mobiles numbers separated by comma //Sender ID,While using route4 sender id should be 6 characters long. //Your message to send, Add URL encoding here. //encoding message //Send SMS API //Prepare parameter string StringBuilder sbPostData= new StringBuilder(mainUrl); sbPostData.append("user="+user); sbPostData.append("&pass="+pass); sbPostData.append("&mobiles="+mobiles); sbPostData.append("&message="+encoded_message); sbPostData.append("&sid="+sid); //final string mainUrl = sbPostData.toString(); try { //prepare connection myURLConnection = myURL.openConnection(); myURLConnection.connect(); //reading response String response; while ((response = reader.readLine()) != null) //print response Log.d("RESPONSE", ""+response); //finally close connection reader.close(); } { e.printStackTrace(); }
URL: https://broadnet.me/developer-tools/sms-sample-code/java-sample-code-sms.html