Tabnine Logo
WhatsappApi
Code IndexAdd Tabnine 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)

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

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Top PhpStorm plugins
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