Send Unicode SMS Using Java

Java 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"

  1. Change the un (username)
  2. Change pwd (password) with your username and password
  3. Change the dstno (destination number) to your destination number with full country code


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 Us

Please 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:

  • 1800 87 7061 (Malaysia Toll Free)
  • +604 642 0621 (Penang, Malaysia)
  • +603 2780 3880 (Line 1 Kuala Lumpur, Malaysia)
  • +603 7980 1388 (Line 2 Kuala Lumpur, Malaysia)

Fax:

  • +604 611 5620 (Penang, Malaysia)
  • +603 7980 2388 (Kuala Lumpur, Malaysia)

Articles

 

SMS Coverage for All Countries Worldwide

A B C D E F G H I J K L M N O P Q R S T U V Y Z
divider