congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
WhatsappApi$2.execute
Code IndexAdd Tabnine to your IDE (free)

How to use
execute
method
in
com.mega4tech.whatsappapilibrary.WhatsappApi$2

Best Java code snippets using com.mega4tech.whatsappapilibrary.WhatsappApi$2.execute (Showing top 1 results out of 1,395)

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();
}
com.mega4tech.whatsappapilibraryWhatsappApi$2execute

Popular methods of WhatsappApi$2

    Popular in Java

    • Reading from database using SQL prepared statement
    • getSupportFragmentManager (FragmentActivity)
    • getSharedPreferences (Context)
    • getContentResolver (Context)
    • Container (java.awt)
      A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
    • Time (java.sql)
      Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
    • Enumeration (java.util)
      A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
    • HashSet (java.util)
      HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
    • Join (org.hibernate.mapping)
    • LoggerFactory (org.slf4j)
      The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
    • Top plugins for Android Studio
    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