Codota Logo
WhatsappApi
Code IndexAdd Codota to your IDE (free)

How to use
WhatsappApi
in
com.mega4tech.whatsappapilibrary

Best Java code snippets using com.mega4tech.whatsappapilibrary.WhatsappApi (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: omegaes/Whatsapp-API

public void sendMessage(WContact contact, WMessage message, Context context, SendMessageListener listener) throws IOException, WhatsappNotInstalledException {
  List<WContact> contacts = new LinkedList<>();
  contacts.add(contact);
  sendMessage(contacts, message, context, listener);
}
origin: omegaes/Whatsapp-API

public static WhatsappApi getInstance() {
  if (instance == null)
    instance = new WhatsappApi();
  return instance;
}
origin: omegaes/Whatsapp-API

mReceivers = new LinkedList<>();
if (!WhatsappApi.getInstance().isWhatsappInstalled()) {
  Toast.makeText(this, "Whatsapp not installed", Toast.LENGTH_SHORT).show();
  return;
if (!WhatsappApi.getInstance().isRootAvailable()) {
  Toast.makeText(this, "Root is not available", Toast.LENGTH_SHORT).show();
  return;
  WhatsappApi.getInstance().getContacts(this, new GetContactsListener() {
    @Override
    public void receiveWhatsappContacts(List<WContact> contacts) {
origin: omegaes/Whatsapp-API

WhatsappApi.getInstance().sendMessage(mReceivers, message, this, new SendMessageListener() {
  @Override
  public void finishSendWMessage(List<WContact> contact, WMessage message) {
origin: omegaes/Whatsapp-API

public synchronized void getContacts(Context context, final GetContactsListener listener) throws WhatsappNotInstalledException {
  if (isWhatsappInstalled()) {
    new AsyncTask<Void, Void, List<WContact>>() {
      @Override
      protected List<WContact> doInBackground(Void... params) {
        Shell.SU.run("am force-stop com.whatsapp");
        db = SQLiteDatabase.openOrCreateDatabase(new File("/data/data/com.whatsapp/databases/wa.db"), null);
        List<WContact> contactList = new LinkedList<>();
        String selectQuery = "SELECT  jid, display_name FROM wa_contacts where phone_type is not null and is_whatsapp_user = 1";
        Cursor cursor = db.rawQuery(selectQuery, null);
        if (cursor.moveToFirst()) {
          do {
            WContact contact = new WContact(cursor.getString(1), cursor.getString(0));
            contactList.add(contact);
          } while (cursor.moveToNext());
        }
        db.close();
        return contactList;
      }
      @Override
      protected void onPostExecute(List<WContact> contacts) {
        super.onPostExecute(contacts);
        if (listener != null) {
          listener.receiveWhatsappContacts(contacts);
        }
      }
    }.execute();
  } else
    throw new WhatsappNotInstalledException();
}
origin: omegaes/Whatsapp-API

    break;
sendBigMessage(contact.getId(), message.getText(), name, message.getMime());
origin: omegaes/Whatsapp-API

public synchronized void sendMessage(final List<WContact> contacts, final WMessage message, final Context context, final SendMessageListener listener) throws IOException, WhatsappNotInstalledException {
  if (isWhatsappInstalled()) {
    new AsyncTask<Void, Void, Boolean>() {
      @Override
com.mega4tech.whatsappapilibraryWhatsappApi

Javadoc

Created by aboodba on 02/03/2017.

Most used methods

  • isWhatsappInstalled
  • sendMessage
  • <init>
  • getContacts
  • getInstance
  • isRootAvailable
  • sendBigMessage

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • getContentResolver (Context)
  • onRequestPermissionsResult (Fragment)
  • Kernel (java.awt.image)
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JTextField (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now