Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.
/ JavaWhatsApp Public archive

Send and listen messages through WhatsApp from a Java Program.

Notifications You must be signed in to change notification settings

Margaruga/JavaWhatsApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JavaWhatsApp

This project has been continued by DevSplash on this repo: https://github.com/DevSplash/WhatsApp4Java

Send and listen messages through WhatsApp from a Java Program.

This is done thanks to Yowsup: https://github.com/tgalal/yowsup

This works as is today but it hasn't been tested deeply, I just shared it because it may be helpful for someone.

# Steps

  • cc=

  • phone=

  • id=

  • password=

    • The Whatsapp folder is a Netbeans Maven project that contains a package with all the necessary. It also has a demo to show how it works.

      package com.nqysit.whatsapp;
      
      import java.util.ArrayList;
      
      
      public class EchoDemo {
      
          public static void main(String[] args) throws ClientIsNotInit {
      
              boolean run = true;
      
              Client.init("/usr/bin/python", "JavaWhatsApp/yowsup/yowsupclient.py");
      
              while (run) {
      
                  Client.ListenIncomingMessages();
      
                  ArrayList<Contact> unreaden = Client.getUnseenContacts();
      
                  if (!unreaden.isEmpty()) {
      
                      for (Contact ur : unreaden) {
      
                          String from = ur.getNumber();
                          String text = ur.getUnseenMessage();
      
                          System.out.println(from + "-" + text);
      
                          if (text.equals("stop")) {
                              Client.killit();
                              run = false;
                              break;
                          }
      
                          Client.sendMessage(from, text);
      
                      }
      
                  } else {
      
                      System.out.println("There are not new messages");
      
                  }
              }
          }
      
      }

About

Send and listen messages through WhatsApp from a Java Program.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published