Tabnine Logo
WhatsappApi.isWhatsappInstalled
Code IndexAdd Tabnine to your IDE (free)

How to use
isWhatsappInstalled
method
in
com.mega4tech.whatsappapilibrary.WhatsappApi

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

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

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
origin: omegaes/Whatsapp-API

mReceivers = new LinkedList<>();
if (!WhatsappApi.getInstance().isWhatsappInstalled()) {
  Toast.makeText(this, "Whatsapp not installed", Toast.LENGTH_SHORT).show();
  return;
com.mega4tech.whatsappapilibraryWhatsappApiisWhatsappInstalled

Popular methods of WhatsappApi

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setScale (BigDecimal)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now