Send SMS Using SMS Gateway from Android

send-sms-using-way2sms-android thump

In Android, you can use SmsManager API or devices Built-in application to send SMS’s. Therefore in this tutorial, we shows how to send SMS message using SMS Gateway from android. However Some times it’s important to inform user about changes made to there account by email or sms. Such as verification codes,conformations etc, please let me present some interesting facts in this topic.

At this point about 5.1 billion out of the 6.8 billion people on Earth own a mobile phone – that’s a huge.

There are twice as many active SMS users in the world than active users of email.

On average, it takes 9 minutes for someone to respond to an SMS (by comparison, the response time in case of e-mail is 90 minutes).

Around 98 per cent of all messages are opened, but only 20 per cent of emails are looked at.

send-sms-using-way2sms-android logicchip1

 

Android

Of course first is the android part, it transmit address of the recipient and message to be send. In order to transmit network data we are  using volley. And also the response is received by volley network library. As a matter of fact internet permission is required for this project.

Server

In fact way2sms don’t provide an official api for users. Still there are several api’s available unofficially. As a result of googling found a suitable api. Then modified it to work with android. However you can use wamp or any other free hosting providers as server. In the same way api working and it’s integration is explained below.

Introduction

Accordingly there is a lot of free Sms sending web portals available on the internet. Therefore people use them to send bulk and nonbulk Short messages without any charge. Still Way2Sms is one of the No.1 SMS Portal on the World Wide Web almost 1 million users were registered with them and send millions of message per day. Hence you are going to learn about the Way2Sms Php API Script Integration in an android app in this article.

How Way2Sms API  Script Works:

Consequently by integrating the Way2Sms Php API Script in your app, Your can send  SMS Directly through your app. You are never redirected to Way2Sms official site for login or another purpose. Because every action will take place through your server itself. You can also modify the script design like yours . Because the code was developed using PHP and it was too simple.

How to Integrate Way2Sms PHP API Script:

In fact it’s very easy to integrate the PHP API script on your app or website. In order to do this, you must have a Php Enabled Server (Cpanel). If you don’t have a PHP Supported Server, then create a free A/c on any of the site that listed on the linked page: Link Here

 

After creating an A/c or log in to your Existing Cpanel A/c, Do the following steps and procedure to integrate the  API script on your website. Or you can use wamp instead.

Above all first Download the script from here: Download,

Then Go to File-Browser of your Cpanel A/c & Create a “New Folder” name “androidsms”.

Afterward Upload the “12sms.rar” Downloaded the file to the “androidsms”.

Next Extract the “12sms.rar” File.

Run like: “http://example.com/androidsms/sms.php”.

You are Done.

SMS-Gateway

Accordingly a SMS-Gateway allows a computer to send or receive Short Message Service transmissions to or from a telecommunications network. Most messages are eventually routed into the mobile phone networks. In fact it’s able to send the messages coming from your Android application through HTTP to the SMSC (Short Message Service Center) of the Mobile Service Provider via SMPP IP SMS connection or a GSM modem. However the SMSC is a network element in the mobile telephone network that stores, forwards, converts and delivers SMS messages. Still to be able to send messages using HTTP, you will need an SMS Gateway that has a built-in webserver. In conclusion it allows you to send text messages from your application by calling an URL (HTTP Get) or using the HTTP Post method.

 

Sms.php

In addition below is the modified php script for sending message. It also require other script’s from the rar file.

 

MainActivity.java

Class file contain the sending of information  number and message.

 

Incidentally here is the full code for android: Download.

You Might Also Like

16 Replies to “Send SMS Using SMS Gateway from Android”

      1. sir, could you please help me ..! i have uploaded files on the server and error is occuring which says can’t convert jsonobject to jsonarray..please help

        1. Check what’s actually receiving,by printing the json array.then only you can determine where the problem is.

    1. hello mate.. could you please tell me how you resolved yoour error because i am having the same problem..please help.!

  1. Sir my app is crashing every time i try to send msg and the error is an “NULLPOINTER EXCEPTION” from this line

    34 StringRequest menuRequest = new StringRequest(Request.Method.POST,”http://example.com/androidsms/sms.php”,

  2. Sir,
    I download and put files on D:\xampp5.6.15\htdocs\sendsms. it have 10 files (curl,foot,func,head,index,LICENSE,README.md,readme,sms,style).

  3. Sir,
    I also tried with http://localhost/sendsms/. It ask login mobilenumber i enter like that 9876543210 password : pwd1875 receipt: 9785641023 message: msg from logicchip it show the error ‘check your username and password Inorder to Send SMS’ and also on top it show user: 9876543210

        1. There is no official API for way2sms, it was an workaround method.May be they somehow manage to block that.I will notify you as soon as a solution is found.

          1. Pls inform Any other API like way2sms to send free SMS through internet without any credentials(txtlocal,twilio)

Leave a Reply