Send SMS using Java

Опубликовано: 02 Январь 2021
на канале: Infybuzz
1,263
28

In this video you will learn to send SMS to mobile using Java. We will use textlocal API to send text message on mobile using Java.

We will generate OTP ( One Time Password ) using SplitableRandom class provided by Java 8. That OTP we will send on Mobile so you will learn a real time scenario.

Generate OTP Using Java 8 -    • Generate OTP (One Time Password) Using Java 8  

NOTE - THIS IS ONLY FOR EDUCATION PURPOSE. FOLLOW YOUR LOCAL TELECOM RULES AND REGULATIONS SET BY YOUR GOVERNMENT.

Checkout below Courses Provided by me :-

Build REST API with Spring Boot and Spring Data JPA - https://bit.ly/2ZUT0JO

Learn MongoDB with Java and Spring Boot using Spring Data MongoDB and MongoRepository. - https://bit.ly/3a1pNkb

Learn RabbitMQ : Messaging with Java, Spring Boot And Spring MVC - https://bit.ly/2IRCn9U

Learn Java Messaging Service - Spring MVC, Spring Boot, ActiveMQ - https://bit.ly/2UdN7V4

Java Interview Preparation || 100+ Quality Questions Covered - https://bit.ly/33kzLdX

For more GO HERE - http://www.infybuzz.com

#java #infybuzz #shorts

----------------------------------------------------------------------------------------
Code used in this video

public static void sendSMS (String otpStr) {
try {

String apiKey = "apiKey=" + "";

String message = "&message=" + URLEncoder.encode("Your OTP is " + otpStr,
"UTF-8");

String numbers = "&numbers=" + "";

String apiURL = "https://api.textlocal.in/send/?" + apiKey + message + numbers;

URL url = new URL(apiURL);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);

BufferedReader reader = new BufferedReader(new
InputStreamReader(connection.getInputStream()));

String line = "";
StringBuilder sb = new StringBuilder();

while ( (line = reader.readLine()) != null) {
sb.append(line).append("\n");
}

System.out.println(sb.toString());

} catch (Exception e) {
e.printStackTrace();
}
}


На этой странице сайта вы можете посмотреть видео онлайн Send SMS using Java длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Infybuzz 02 Январь 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,263 раз и оно понравилось 28 зрителям. Приятного просмотра!