1800 87 7061 (Malaysia Toll Free) +603 2780 3880 (KL)
Send Unicode SMS Using JavaJava is popular programming language and it can be used to develop many applications and solutions. To be able to send SMS messages, its capabilities need to be extended to communicate with mobile networks through iSMS gateway. To understand more about our iSMS API Key features, please visit our Developer API page. All available features and configurations will be displayed at the iSMS Developer API page. Integrate our SMS API into your Java application and enjoy our SMS services. Download Java Demo Scripts Please click below to find out about other programming language samples. To start, you need to have an iSMS account ready. If you do not have an account, please register on HERE and next, get your free 5 demo credit by following the register steps HERE. Below, you can go through the scripts and API keys used to send SMS using Java. The phone number parameter can be comma separated value, for instance "0123456789,0134567890". For sending to one recipient, pass the phoneno as "01234567890"
import java.io.*;
import java.net.*; public class isms { public static void main(String[] args) throws Exception { try { String user = "isms"; //user isms username String pass = "isms"; //user isms password String dstno = "6016xxxxxxx"; //You are going compose a message to this destination number. String str = "你好吗?"; //Your message over here String msg = str.replace(" ", "%20"); int type = 2; //for unicode change to 2, normal will the 1. String sendid = "isms"; //Malaysia does not support sender id yet. // Send data URL myUrl = new URL("http://www.isms.com.my/isms_send.php?un=" + user + "&pwd=" + pass + "&dstno=" + dstno + "&msg=" + msg + "&type=" + type + "&sendid=" + sendid); URLConnection conn = myUrl.openConnection(); conn.setDoOutput(true); // Get the response BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; while ((line = rd.readLine()) != null) { // Print the response output... System.out.println(line); } rd.close(); System.out.println(myUrl); } catch (Exception e) { e.printStackTrace(); } } } Please click below to download demo files: Download Java Demo Scripts Contact UsPlease contact us HERE, if you have any enquiries or looking for any consultation. Email: [email protected] Note to registered users: Please include your Username in the email. Phone Numbers:
Fax:
|