30 likes | 54 Views
Adding an SMS API and integrating such an API on android is simple. Try this Android Phone sample code for integrating SMS API in Android
E N D
How To Integrate SMS API In Android Android app development has always been known for its key benefits; some of which necessarily include low investment and high ROI, open source, easy to integrate, multiple sales channels, easy and simplified user interface etc. Now, with the help of an API - short for application programming interface - designing a custom, user-friendly and pinpointed application that works on the android operating system devised by Google is very easy. An API uncomplicated the entire process of app designing and it reduces time to market and development of a product. API Service Providers And SMS Services With the help of an API - from trusted and professional service providers, you can easily streamline the operational tasks and make new products live. An SMS API can be used to send SMS in bulk and using a sophisticated and simpler interface. The entire task of adding an SMS API and integrating such an API on android is simple. Let us tell you how to –
Just visit the website of a professional SMS API and SMS gateway provider Visit the section where they have the codes listed - which you can copy and paste to integrate on your server for automating a defined tasks - such as sending bulk SMS Now, test the result and if you find that the integration has been easy and done; you can then customize the coding and value for more enhanced result. BroadNet is one of the most respected and well known SMS gateway providers which offer you a range of APIs which you can readily use and integrate on your platform. Here is an example code of the SMS API for android integration Android Phone Example Code The following example of Android Phone sample SMS code employs user-friendly object, with a basis on the HTTP API. //Android SMS API integration code //Your application url Provided By Broadnet String ApiUrl = "YourAuthKey"; //Your User Id Provided By Broadnet String user = "user"; //Your password Provided By Broadnet String pass = "*****"; //Multiple mobiles numbers separated by comma String mobiles = "9999999"; //Sender ID,While using route4 sender id should be 6 characters long. String sid = "102234"; //Your message to send, Add URL encoding here. String message = "Test message"; URLConnection myURLConnection=null; URL myURL=null; BufferedReader reader=null; //encoding message String encoded_message=URLEncoder.encode(message); //Prepare parameter string StringBuilder sbPostData= new StringBuilder(ApiUrl); 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
myURL = new URL(mainUrl); myURLConnection = myURL.openConnection(); myURLConnection.connect(); reader= new BufferedReader(new InputStreamReader(myURLConnection.getInputStream())); //reading response String response; while ((response = reader.readLine()) != null) //print response Log.d("RESPONSE", ""+response); //finally close connection reader.close(); } catch (IOException e) { e.printStackTrace(); } BroadNet offers a portfolio of APIs for any of your uses. The improved and simplified use of APIs can help you in the easy integration of services. To learn more about the SMS integration services using BroadNet; please visit the website of BroadNet About the Author BroadNet Technologies is an international leading Business Messaging Solution Provider. It’s joined the GSMA as an Associate Member also it has been awarded certification to the ISO 27001:2013; BroadNet Technologies has been a pioneer in the use of SMS-messaging service across global markets since 2003 thus widening its range of products and services to include Bulk SMS, A2P SMS, HLR Lookup, SMSC Gateway, SMS Firewall, Web Solutions, and Mobile Applications.