Auto send whatsapp message android programmatically

If you have a website and want to open a WhatsApp chat with a pre-filled message, you can use our custom URL scheme to do so. Like most social apps on Android, WhatsApp listens to intents to share media and text. Simply create an intent to share text, for example, and WhatsApp will be displayed by the system picker:. However, if you prefer to share directly to WhatsApp and bypass the system picker, you can do so by using setPackage in your intent:.

Similarly you can use Android's intent system to send media through WhatsApp, once again, using setPackage to restrict the package to WhatsApp if you only want to send to WhatsApp.

Check this developer page for more information. How can we help you? I'm an Android developer, how can I integrate WhatsApp with my app? Here is an example of how to write this on your website: Hello, world! Android intent system Like most social apps on Android, WhatsApp listens to intents to share media and text. Yes No. The article was confusing The article didn't answer my question The solution doesn't work I don't like the feature or policy.

FAQ Home.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. However, this opens up the native messaging app, thereby putting my app's activity in the background.

Is it possible to send the SMS directly without the native messaging app opening up? If yes, how? Learn more. Asked 5 years, 6 months ago. Active 2 years, 2 months ago. Viewed 68k times. So far I am using the following code to send SMS to another phone through my app. SoulRayder SoulRayder 4, 4 4 gold badges 32 32 silver badges 79 79 bronze badges. Oh gr8 downvoter, pray tell me why? That doesn't explicitly mention the underlying issue of native messaging app opening up, though I agree both solutions are mentioned.

This might be a useful material to those who require direct SMS sending approach, since I have explicitly highlighted the differences in the result obtained using the two approaches. Active Oldest Votes. Badakhshan 5 5 silver badges 21 21 bronze badges. Himanshu Agarwal Himanshu Agarwal 4, 5 5 gold badges 30 30 silver badges 48 48 bronze badges. This only works for builds where the API target is older than Does this also add the sent message to the default sms app i.

Please note that if you are publishing your app on google play this is a Policy violation and will get your app suspended eventually. All It's an old answer and currently it's violation of Google Play Policy so kindly don't use above code.

Abhishek Chaubey Abhishek Chaubey 2, 1 1 gold badge 14 14 silver badges 22 22 bronze badges. Himanshu Agarwal 4, 5 5 gold badges 30 30 silver badges 48 48 bronze badges. Dilavar Malek Dilavar Malek 1, 11 11 silver badges 16 16 bronze badges.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

If nothing happens, download GitHub Desktop and try again. If nothing happens, download Xcode and try again. If nothing happens, download the GitHub extension for Visual Studio and try again. Computer will send messages to your friend on WhatsApp Web automatically at fixed interval e.

Using Java Working. Using Javascript Not working. We can send whatsapp message from Android app or from whatsapp web. Making an automatic-message-sender Android app seemed a lot of work to me. Initially I thought writing some javascript code in browser console will do the work but I got stuck in middle. Idea is to simulate 'message-typing' and 'sending' like real user on WhatsApp Web.

To see this approach please see whatsapp. I chose Java for it. I used java. Robot class for this purpose and this was my 2nd working approach. See Video to feel it. Please visit. Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. Automatic message sender using WhatsApp Web at fixed interval. Java JavaScript. Java Branch: master. Find file. Sign in Sign up.

Go back. Launching Xcode If nothing happens, download Xcode and try again. Latest commit. Latest commit 7ada4f3 Sep 6, How does it work?

Sending message from your application to a WhatsApp Number

You define your messages into Java class. You go to sleep and have nice dreams. What's next? You can make a chatbot which will be able to respond to incoming messages wisely.

You signed in with another tab or window.WhatsApp is the most popular instant messaging service. Nowadays even organizations use it to connect with customers. Sometimes customers have frequently asked questions.

Due to lack of man power or time, organizations are unable to answer all the queries in real time. Setting up predefined answers to these common questions on WhatsApp can help the business going. Not just organizations but this could also help individuals.

auto send whatsapp message android programmatically

So to set this up, you will need a rooted Android phone. Also it works with Android phone with OS 4. This all without you having to open the app. Apart from this the app has general settings too wherein you can whitelist or blacklist contacts. However that is available only for pro users. You can also avoid any duplicate responses from sending. People usually have habit of playing with bots so this can help in such situation.

WhatsApp itself adds new features over the time but to get something like this, you need a rooted phone. You can add as many rules as you want with this app. Thus, you can send an automatic reply to any WhatsApp message in Android phone.

auto send whatsapp message android programmatically

Surprise your friends or customers with this little but useful trick. Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker. Prev Article. Next Article. Ad Blocker Detected Our website is made possible by displaying online advertisements to our visitors.In this blog. And After Following this blog, you will see that reading the documentation is hard than implementing the same.

As per the official documents and my implementation of the docs you can directly use below-shared Code Segment for the aforesaid purpose.

Subscribe to RSS

But if you want to send a particular message to a particular user from your application to WhatsApp. All you need to do is to implement this segment of code and everything will work fine. The code snippet in the blog are complete.

All you need to do is adjust the message and contact number as per your use. The explanation in the blog as per me is sufficient for any reader to read and implement this functionality.

Still, if you have doubts in any point do let me know and i will try to improvise the same in blog. Moreover, if you still have any errors in the code then share the code with me and i will help you out, regarding the same.

For starting you can try reading AccessibilityService from the core android packages and then modifying it to achieve what you want. But as someone in other comments suggested using appium or something that can really find the send button and automatically push the message. Also, for the approach shared in the article it requires user to press the final send button on the whatsApp Screen so that the mesaage actually is delivered to the intended number.

But the approaches discussed in the blog will work definitively for core android as it is using only intents and uri scheme. Please note that you need to pass the Uri of the image file you want to share as an argument to this function. But if I was in your place, I would use a fusion of the second approach in the blog and image sharing code i have described in previous comments. If you have a list of contacts then obviously you can use a for loop for iterating over the numbers that you want to send the message to.

auto send whatsapp message android programmatically

You can also try sending multiple numbers as comma separated strings in the last approach shared in the blog. For Facebook you need to ahave a look into the facebook sdk documentation, enable the same from their developer console and then use that feature as per thier instructions.

But if you are going to send a raw file then exactly there is no proper documentation for you. But you can try doing this with the help of intent with action send and passing your pdf file as text argument of the intent in the form of byte array. Do you need any logical explanations for this implementation of the requirement above? I would suggest you contact them.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. However, this opens up the native messaging app, thereby putting my app's activity in the background. Is it possible to send the SMS directly without the native messaging app opening up? If yes, how? How are we doing? Please help us improve Stack Overflow. Take our short survey. Learn more. Asked 5 years, 6 months ago. Active 2 years, 2 months ago.

Viewed 68k times. So far I am using the following code to send SMS to another phone through my app. SoulRayder SoulRayder 4, 4 4 gold badges 32 32 silver badges 79 79 bronze badges. Oh gr8 downvoter, pray tell me why? That doesn't explicitly mention the underlying issue of native messaging app opening up, though I agree both solutions are mentioned. This might be a useful material to those who require direct SMS sending approach, since I have explicitly highlighted the differences in the result obtained using the two approaches.

Active Oldest Votes. Badakhshan 5 5 silver badges 21 21 bronze badges. Himanshu Agarwal Himanshu Agarwal 4, 5 5 gold badges 30 30 silver badges 48 48 bronze badges.

This only works for builds where the API target is older than Does this also add the sent message to the default sms app i. Please note that if you are publishing your app on google play this is a Policy violation and will get your app suspended eventually.

All It's an old answer and currently it's violation of Google Play Policy so kindly don't use above code. Abhishek Chaubey Abhishek Chaubey 2, 1 1 gold badge 14 14 silver badges 22 22 bronze badges.

Himanshu Agarwal 4, 5 5 gold badges 30 30 silver badges 48 48 bronze badges. Dilavar Malek Dilavar Malek 1, 11 11 silver badges 16 16 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog.

Android Studio Tutorial - How to Create Simple Sms Sender or Messaging App

Podcast Cryptocurrency-Based Life Forms. Q2 Community Roadmap. Featured on Meta. Community and Moderator guidelines for escalating issues via new response….Whatsapp messenger as known is the largest social messaging app according to global statistics. However, most users still need an automatic reply for all their whatsapp messages while away.

The automatic responder features for whatsapp messages is a very brilliant feature. This makes those who message you feel your presence when you are away. You can call it a chat bot, which analysis message sent to you and give your recipients a corresponding feedback. In most cases, you just need to setup rules while you are away. You make an input on what respond your friends get on incoming message, I call this setting rules.

However, you get to select contacts for automated response maybe business contacts or related. Since you are connected to many on whatsapp, I advise you go with this. Autoresponder for whatsapp is a common auto reply bot used on rooted android devices. This app helps send automatic custom replies, create unlimited rules for incoming message and response, customize rules for individual contacts, reacts to every incoming messages, send replies to specific messages, welcomes new chats, ignore and specify contacts and groups, backup rules and lots more features.

In other to make use of this app, all you need to do is root your android device. Install the app and launch. After launch, the app would request for root permission, please grant the app access to root and get over with whatever settings needed for the app.

You can also reply to every incoming message just in case you are busy. You also get to create as many rules as possible as seen in the image below, alongside editing rules, and deleting selected rules if necessary. Time to time, when you get to master the app, you discover more features and tools. If you own a non-rooted android device, then I advise you implement the second method.

Whatreply is an alternative to autoresponder for messages. The app is used to set automatic replies for every incoming messages on your WhatsApp. This is more reason you should use your android device.

I advise you take a good look at the benefits of rooting your android devices. Anyways, whatreply serves primary purpose, which is giving an automatic responds to every message. You get to set your rule for received and replies and also some few other setups needed to keep going. The application setup is simplified and user-friendly.

So get handy use of the app and setup auto response for your messages.

Send and receive messages

Just in case you need any assistance, or elaboration in some certain stage on usage of the app, please do let me know via comment section. Sign in. Forgot your password? Get help. Create an account. Password recovery. Home How to How to automatically send whatsapp messages on Android. Share on Facebook. Method 1 — Using AutoResponder for WhatsApp [auto reply bot] [for rooted devices] Autoresponder for whatsapp is a common auto reply bot used on rooted android devices.

Method 2 — using Whatreply on whatsapp [for non-rooted devices] Whatreply is an alternative to autoresponder for messages. How to Permanently turn-off automatic update on Windows Must Read.


Comments on “Auto send whatsapp message android programmatically