text:
Q: Send text to specific contact programmatically (whatsapp) I wanted to know how I can send text to a specific whatsapp contact. I found some code to view a specific contact, but not to send data.
Cursor c = getContentResolver().query(ContactsContract.Data.CONTENT_URI,
    new String[] { ContactsContract.Contacts.Data._ID }, ContactsContract.Data.DATA1 + "=?",
    new String[] { id }, null);
c.moveToFirst();
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("content://com.android.contacts/data/" + c.getString(0)));

startActivity(i);
c.close();

This works fine for viewing a whatsapp-contact, but how can I add some text now? Or didn't the Whatsapp-developer implement such kind of an api?

A: I've found the right way to do this:
Source code: phone and message are both String.
    PackageManager packageManager = context.getPackageManager();
    Intent i = new Intent(Intent.ACTION_VIEW);

    try {
        String url = "https://api.whatsapp.com/send?phone="+ phone +"&text=" + URLEncoder.encode(message, "UTF-8");
        i.setPackage("com.whatsapp");
        i.setData(Uri.parse(url));
        if (i.resolveActivity(packageManager) != null) {
            context.startActivity(i);
        }
    } catch (Exception e){
        e.printStackTrace();
    }

Enjoy yourself!

A: I think the answer is a mix of your question and this answer here: https://stackoverflow.com/a/15931345/734687
So I would try the following code:

*

*change ACTION_VIEW to ACTION_SENDTO

*set the Uri as you did

*set the package to whatsapp

Intent i = new Intent(Intent.ACTION_SENDTO, Uri.parse("content://com.android.contacts/data/" + c.getString(0)));
i.setType("text/plain");
i.setPackage("com.whatsapp");           // so that only Whatsapp reacts and not the chooser
i.putExtra(Intent.EXTRA_SUBJECT, "Subject");
i.putExtra(Intent.EXTRA_TEXT, "I'm the body.");
startActivity(i);

I looked into the Whatsapp manifest and saw that ACTION_SEND is registered to the activity ContactPicker, so that will not help you. However ACTION_SENDTO is registered to the activity com.whatsapp.Conversation which sounds more adequate for your problem.
Whatsapp can work as a replacement for sending SMS, so it should work like SMS. When you do not specify the desired application (via setPackage) Android displays the application picker. Thererfor you should just look at the code for sending SMS via intent and then provide the additional package information.
Uri uri = Uri.parse("smsto:" + smsNumber);
Intent i = new Intent(Intent.ACTION_SENDTO, uri);
i.putExtra("sms_body", smsText);
i.setPackage("com.whatsapp");
startActivity(i);

First try just to replace the intent ACTION_SEND to ACTION_SENDTO . If this does not work than provide the additional extra sms_body. If this does not work than try to change the uri.
Update
I tried to solve this myself and was not able to find a solution. Whatsapp is opening the chat history, but doesn't take the text and send it. It seems that this functionality is just not implemented.

A: I have done it!
private void openWhatsApp() {
    String smsNumber = "7****"; // E164 format without '+' sign
    Intent sendIntent = new Intent(Intent.ACTION_SEND);
    sendIntent.setType("text/plain");
    sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
    sendIntent.putExtra("jid", smsNumber + "@s.whatsapp.net"); //phone number without "+" prefix
    sendIntent.setPackage("com.whatsapp");
    if (intent.resolveActivity(getActivity().getPackageManager()) == null) {
        Toast.makeText(this, "Error/n" + e.toString(), Toast.LENGTH_SHORT).show();
        return;
    }
    startActivity(sendIntent);
}

A: This will first search for the specified contact and then open a chat window.
And if WhatsApp is not installed then try-catch block handle this.
    String digits = "\\d+";
    String mob_num = "987654321";
    if (mob_num.matches(digits))
            {
        try {
              //linking for whatsapp
              Uri uri = Uri.parse("whatsapp://send?phone=+91" + mob_num);
              Intent i = new Intent(Intent.ACTION_VIEW, uri);
              startActivity(i);
            }
            catch (ActivityNotFoundException e){
                    e.printStackTrace();
                    //if you're in anonymous class pass context like "YourActivity.this"
                    Toast.makeText(this, "WhatsApp not installed.", Toast.LENGTH_SHORT).show();
            }
        }

A: Here am trying to send a text message in WhatsApp with another application.
Assume that we have a button, on button click ur calling below method.
sendTextMsgOnWhatsApp("+91 9876543210", "Hello, this my test message");
public void sendTextMsgOnWhatsApp(String sContactNo, String sMessage) {
        String toNumber = sContactNo; // contains spaces, i.e., example +91 98765 43210
        toNumber = toNumber.replace("+", "").replace(" ", "");

        /*this method contactIdByPhoneNumber() will get unique id for given contact,
        if this return's null then it means that you don't have any contact save with this mobile no.*/
        String sContactId = contactIdByPhoneNumber(toNumber);

        if (sContactId != null && sContactId.length() > 0) {

            /*
             * Once We get the contact id, we check whether contact has a registered with WhatsApp or not.
             * this hasWhatsApp(hasWhatsApp) method will return null,
             * if contact doesn't associate with whatsApp services.
             * */
            String sWhatsAppNo = hasWhatsApp(sContactId);

            if (sWhatsAppNo != null && sWhatsAppNo.length() > 0) {
                Intent sendIntent = new Intent("android.intent.action.MAIN");
                sendIntent.putExtra("jid", toNumber + "@s.whatsapp.net");
                sendIntent.putExtra(Intent.EXTRA_TEXT, sMessage);
                sendIntent.setAction(Intent.ACTION_SEND);
                sendIntent.setPackage("com.whatsapp");
                sendIntent.setType("text/plain");
                startActivity(sendIntent);
            } else {
                // this contact does not exist in any WhatsApp application
                Toast.makeText(this, "Contact not found in WhatsApp !!", Toast.LENGTH_SHORT).show();
            }
        } else {
            // this contact does not exist in your contact
            Toast.makeText(this, "create contact for " + toNumber, Toast.LENGTH_SHORT).show();
        }
    }

    private String contactIdByPhoneNumber(String phoneNumber) {
        String contactId = null;
        if (phoneNumber != null && phoneNumber.length() > 0) {
            ContentResolver contentResolver = getContentResolver();
            Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
            String[] projection = new String[]{ContactsContract.PhoneLookup._ID};

            Cursor cursor = contentResolver.query(uri, projection, null, null, null);

            if (cursor != null) {
                while (cursor.moveToNext()) {
                    contactId = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.PhoneLookup._ID));
                }
                cursor.close();
            }
        }
        return contactId;
    }

    public String hasWhatsApp(String contactID) {
        String rowContactId = null;
        boolean hasWhatsApp;

        String[] projection = new String[]{ContactsContract.RawContacts._ID};
        String selection = ContactsContract.RawContacts.CONTACT_ID + " = ? AND " + ContactsContract.RawContacts.ACCOUNT_TYPE + " = ?";
        String[] selectionArgs = new String[]{contactID, "com.whatsapp"};
        Cursor cursor = getContentResolver().query(ContactsContract.RawContacts.CONTENT_URI, projection, selection, selectionArgs, null);
        if (cursor != null) {
            hasWhatsApp = cursor.moveToNext();
            if (hasWhatsApp) {
                rowContactId = cursor.getString(0);
            }
            cursor.close();
        }
        return rowContactId;
    }

Add this below permission in AndroidManifest.xml file
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />

A: This is the shortest way
    String mPhoneNumber = "+972505555555";
    mPhoneNumber = mPhoneNumber.replaceAll("+", "").replaceAll(" ", "").replaceAll("-","");
    String mMessage = "Hello world";
    String mSendToWhatsApp = "https://wa.me/" + mPhoneNumber + "?text="+mMessage;
    startActivity(new Intent(Intent.ACTION_VIEW,
            Uri.parse(
                    mSendToWhatsApp
            )));

See also the documentation of WhatsApp

A: try {
                    String text = "Hello, Admin sir";// Replace with your message.

                    String toNumber = "xxxxxxxxxxxx"; // Replace with mobile phone number without +Sign or leading zeros, but with country code
                    //Suppose your country is India and your phone number is "xxxxxxxxxx", then you need to send "91xxxxxxxxxx".

                    Intent intent = new Intent(Intent.ACTION_VIEW);
                    intent.setData(Uri.parse("http://api.whatsapp.com/send?phone=" + toNumber + "&text=" + text));
                    context.startActivity(intent);
                } catch (Exception e) {
                    e.printStackTrace();
                    context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=com.whatsapp")));

                }

A: This is now possible through the WhatsApp Business API. Only businesses may apply to use it. This is the only way to directly send messages to phone numbers, without any human interaction.
Sending normal messages is free. It looks like you need to host a MySQL database and the WhatsApp Business Client on your server.

A: you can also select WhatsApp business vs WhatsApp
String url = "https://api.whatsapp.com/send?phone=" + phoneNumber + "&text=" +
  URLEncoder.encode(messageText, "UTF-8");
  if(useWhatsAppBusiness){
    intent.setPackage("com.whatsapp.w4b");
  } else {
    intent.setPackage("com.whatsapp");
  }
  URLEncoder.encode(messageText, "UTF-8");
  intent.setData(Uri.parse(url));

  if (intent.resolveActivity(packageManager) != null) {
    startActivity(intent);
  } else {
    Toast.makeText(this, "WhatsApp application not found", Toast.LENGTH_SHORT).show();
  }

A: This approach works with WhatsApp Business app as well!
Change package name as sendIntent.setPackage("com.whatsapp.w4b"); for WhatsApp Business.
Great hack Rishabh, thanks a lot, I was looking for this solution since last 3 years.
As per the Rishabh Maurya's answer above, I have implemented this code which is working fine for both text and image sharing on WhatsApp.
Note that in both the cases it opens a whatsapp conversation (if toNumber exists in users whatsapp contact list), but user have to click send button to complete the action. That means it helps in skipping contact selection step.
For text messages
String toNumber = "+91 98765 43210"; // contains spaces.
toNumber = toNumber.replace("+", "").replace(" ", "");

Intent sendIntent = new Intent("android.intent.action.MAIN");
sendIntent.putExtra("jid", toNumber + "@s.whatsapp.net");
sendIntent.putExtra(Intent.EXTRA_TEXT, message);
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.setPackage("com.whatsapp");
sendIntent.setType("text/plain");
startActivity(sendIntent);

For sharing images
String toNumber = "+91 98765 43210"; // contains spaces.
toNumber = toNumber.replace("+", "").replace(" ", "");

Intent sendIntent = new Intent("android.intent.action.MAIN");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(imageFile));
sendIntent.putExtra("jid", toNumber + "@s.whatsapp.net");
sendIntent.putExtra(Intent.EXTRA_TEXT, message);
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.setPackage("com.whatsapp");
sendIntent.setType("image/png");
context.startActivity(sendIntent);

Enjoy WhatsApping!

A: try this, worked for me ! . Just use intent
   Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(whatsappUrl()));
   startActivity(intent);

Build whatsapp url. add country code in whatsapp phone number https://countrycode.org/
public static String whatsappUrl(){

    final String BASE_URL = "https://api.whatsapp.com/";
    final String WHATSAPP_PHONE_NUMBER = "628123232323";    //'62' is country code for Indonesia
    final String PARAM_PHONE_NUMBER = "phone";
    final String PARAM_TEXT = "text";
    final String TEXT_VALUE = "Hello, How are you ?";

    String newUrl = BASE_URL + "send";

    Uri builtUri = Uri.parse(newUrl).buildUpon()
            .appendQueryParameter(PARAM_PHONE_NUMBER, WHATSAPP_PHONE_NUMBER)
            .appendQueryParameter(PARAM_TEXT, TEXT_VALUE)
            .build();

    return buildUrl(builtUri).toString();
}

public static URL buildUrl(Uri myUri){

    URL finalUrl = null;
    try {
        finalUrl = new URL(myUri.toString());
    } catch (MalformedURLException e) {
        e.printStackTrace();

    }
    return finalUrl;
}

A:
Send a text to specific contact programmatically (Whatsapp)

try {
    val i = Intent(Intent.ACTION_VIEW)
    val url = "https://api.whatsapp.com/send?phone=91XXXXXXXXXX&text=yourmessage"
    i.setPackage("com.whatsapp")
    i.data = Uri.parse(url)
    startActivity(i)
} catch (e: Exception) {
   e.printStackTrace()
   val uri = Uri.parse("market://details?id=com.whatsapp")
   val goToMarket = Intent(Intent.ACTION_VIEW, uri)
   startActivity(goToMarket)
}

A: It lets you open WhatsApp conversation screen for that specific user you are trying to communicate with:
private void openWhatsApp() {
    String smsNumber = "91XXXXXXXX20";
    boolean isWhatsappInstalled = whatsappInstalledOrNot("com.whatsapp");
    if (isWhatsappInstalled) {

        Intent sendIntent = new Intent("android.intent.action.MAIN");
        sendIntent.setComponent(new ComponentName("com.whatsapp", "com.whatsapp.Conversation"));
        sendIntent.putExtra("jid", PhoneNumberUtils.stripSeparators(smsNumber) + "@s.whatsapp.net");//phone number without "+" prefix

        startActivity(sendIntent);
    } else {
        Uri uri = Uri.parse("market://details?id=com.whatsapp");
        Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
        Toast.makeText(this, "WhatsApp not Installed",
                Toast.LENGTH_SHORT).show();
        startActivity(goToMarket);
    }
}

private boolean whatsappInstalledOrNot(String uri) {
    PackageManager pm = getPackageManager();
    boolean app_installed = false;
    try {
        pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
        app_installed = true;
    } catch (PackageManager.NameNotFoundException e) {
        app_installed = false;
    }
    return app_installed;
}

A: Check out my answer : https://stackoverflow.com/a/40285262/5879376
 Intent sendIntent = new Intent("android.intent.action.MAIN");
 sendIntent.setComponent(new  ComponentName("com.whatsapp","com.whatsapp.Conversation"));
 sendIntent.putExtra("jid", PhoneNumberUtils.stripSeparators("YOUR_PHONE_NUMBER")+"@s.whatsapp.net");//phone number without "+" prefix

 startActivity(sendIntent);

Update:
The aforementioned hack cannot be used to add any particular message, so here is the new approach. Pass the user mobile in international format here without any brackets, dashes or plus sign. Example: If the user is of India and his mobile number is 94xxxxxxxx , then international format will be 9194xxxxxxxx. Don't miss appending country code as a prefix in mobile number.
  private fun sendMsg(mobile: String, msg: String){
    try {
        val packageManager = requireContext().packageManager
        val i = Intent(Intent.ACTION_VIEW)
        val url =
            "https://wa.me/$mobile" + "?text=" + URLEncoder.encode(msg, "utf-8")
        i.setPackage("com.whatsapp")
        i.data = Uri.parse(url)
        if (i.resolveActivity(packageManager) != null) {
            requireContext().startActivity(i)
        }
    } catch (e: Exception) {
        e.printStackTrace()
    }
}

Note: This approach works only with contacts added in user's Whatsapp
account.

A: Whatsapp have its own API
    Intent sendIntent = new Intent("android.intent.action.MAIN");
                        sendIntent.setAction(Intent.ACTION_VIEW);
                        sendIntent.setPackage("com.whatsapp");
                        String url = "https://api.whatsapp.com/send?phone=" + "Phone with international format" + "&text=" + "your message";
                        sendIntent.setData(Uri.parse(url));
                        if(sendIntent.resolveActivity(context.getPackageManager()) != null){
                             startActivity(sendIntent);
                        }

Code updated check added for Activity is available or not.
See this documentation

A:  private void openWhatsApp() {
       //without '+'
        try {
            Intent sendIntent = new Intent("android.intent.action.MAIN");

            //sendIntent.setComponent(new ComponentName("com.whatsapp", "com.whatsapp.Conversation"));
            sendIntent.setAction(Intent.ACTION_SEND);
            sendIntent.setType("text/plain");
            sendIntent.putExtra("jid",whatsappId);
            sendIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            sendIntent.setPackage("com.whatsapp");
            startActivity(sendIntent);
        } catch(Exception e) {
            Toast.makeText(this, "Error/n" + e.toString(), Toast.LENGTH_SHORT).show();
            Log.e("Error",e+"")    ;    }
    }

A: In Python, you can do it the same way we do it with mobile application
 web.open('https://web.whatsapp.com/send?phone='+phone_no+'&text='+message)

This will prepopulate the text for given mobile number(Enter the phone_no as CountryCode and the number eg +918888888888)
Then using pyautogui you can press enter onto whatsapp.web
Working code :
def sendwhatmsg(phone_no, message, time_hour, time_min):
     '''Sends whatsapp message to a particulal number at given time'''
     if time_hour == 0:
         time_hour = 24
     callsec = (time_hour*3600)+(time_min*60)

     curr = time.localtime()
     currhr = curr.tm_hour
     currmin = curr.tm_min
     currsec = curr.tm_sec

     currtotsec = (currhr*3600)+(currmin*60)+(currsec)
     lefttm = callsec-currtotsec

     if lefttm <= 0:
         lefttm = 86400+lefttm

     if lefttm < 60:
         raise Exception("Call time must be greater than one minute")

     else:
         sleeptm = lefttm-60
         time.sleep(sleeptm)
         web.open('https://web.whatsapp.com/send?phone='+phone_no+'&text='+message)
         time.sleep(60)
         pg.press('enter')

I've taken this from this repository - Github repo

A: This code is implemented with Kotlin.
I have 2 versions:
1) For known contacts
private fun openWhatsApp(dato: WhatsApp) {
    val isAppInstalled = appInstalledOrNot("com.whatsapp")
    if (isAppInstalled) {
        val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://api.whatsapp.com/send?phone=${dato.whatsapp}"))
        startActivity(intent)
    } else {
        // WhatsApp not installed show toast or dialog
    }
}

private fun appInstalledOrNot(uri: String): Boolean {
    val pm = requireActivity().packageManager
    return try {
        pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES)
        true
    } catch (e: PackageManager.NameNotFoundException) {
        false
    }
}

In the case of being an unknown contact WhatsApp shows the following message

2) For unknown contacts
private fun openWhatsApp(dato: WhatsApp) {
    val isAppInstalled = appInstalledOrNot("com.whatsapp")
    if (isAppInstalled) {
        val sendIntent = Intent("android.intent.action.MAIN")
        sendIntent.setType("text/plain")
        sendIntent.setComponent(ComponentName("com.whatsapp", "com.whatsapp.Conversation"))
        sendIntent.putExtra("jid", PhoneNumberUtils.stripSeparators(dato.whatsapp) + "@s.whatsapp.net")
        startActivity(sendIntent)
    } else {
        // WhatsApp not installed show toast or dialog
    }
}

private fun appInstalledOrNot(uri: String): Boolean {
    val pm = requireActivity().packageManager
    return try {
        pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES)
        true
    } catch (e: PackageManager.NameNotFoundException) {
        false
    }
}

A: Here is a way how to send message in WhatsApp in KOTLIN
    private fun sendMessage(phone: String, message: String) {
        val pm = requireActivity().packageManager
        val i = Intent(Intent.ACTION_VIEW)
        try {
            val url = "https://api.whatsapp.com/send?phone=$phone&text=" + URLEncoder.encode(
                message,
                "UTF-8"
            )
            i.setPackage("com.whatsapp")
            i.data = Uri.parse(url)
            if (i.resolveActivity(pm) != null) {
                context?.startActivity(i)
            }
        } catch (e: PackageManager.NameNotFoundException) {
            Toast.makeText(requireContext(), "WhatsApp not Installed", Toast.LENGTH_SHORT).show()
        }
    }

A: Use this function. Don't forget to save the WhatsApp Number on your mobile before sending trigger the function.
private void openWhatsApp() {
        Uri uri = Uri.parse("smsto:"+ "12345");
        Intent i = new Intent(Intent.ACTION_SENDTO,uri);
        i.setPackage("com.whatsapp");
        startActivity(i);
    }

A: Update 2020
     String number="+91 7*********";
            String url="https://api.whatsapp.com/send?phone="+number + "&text=" + "Your text here";
            Intent i=new Intent(Intent.ACTION_VIEW);
            i.setData(Uri.parse(url));
            startActivity(i);

A: The following will open up the Whatsapp conversation (with a contact) page and prefill it with the text provided. Note: This is not going to automatically send the text off to the Whatsapp servers. It will only open the conversation page. The user needs to explicitly press the "Send" button to actually have the text sent to the servers.
String phoneId = "+1415xxxyyyy"; // the (Whatsapp) phone number of contact
String text = "text to send";

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("text/plain");
sendIntent.putExtra(Intent.EXTRA_TEXT, text);
sendIntent.putExtra("jid", phoneId);
sendIntent.setPackage("com.whatsapp");
startActivity(sendIntent);

A: Check this answer. Here your number start with "91**********".
Intent sendIntent = new Intent("android.intent.action.MAIN");
sendIntent.setAction(Intent.ACTION_SEND);

sendIntent.setType("text/plain");
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");                   sendIntent.putExtra("jid",PhoneNumberUtils.stripSeparators("91**********")                   + "@s.whatsapp.net");
sendIntent.setPackage("com.whatsapp");
startActivity(sendIntent);

A: This will first search for the specified contact and then open a chat window.
Note: phone_number and str are variables.
Uri mUri = Uri.parse("https://api.whatsapp.com/send?
phone=" + phone_no + "&text=" + str);
Intent mIntent = new Intent("android.intent.action.VIEW", mUri);
mIntent.setPackage("com.whatsapp");
startActivity(mIntent);

A: Bitmap bmp = null;
            bmp = ((BitmapDrawable) tmpimg.getDrawable()).getBitmap();
            Uri bmpUri = null;
            try {
                File file = new File(getBaseContext().getExternalFilesDir(Environment.DIRECTORY_PICTURES), "share_image_" + System.currentTimeMillis() + ".jpg");
                FileOutputStream out = new FileOutputStream(file);
                bmp.compress(Bitmap.CompressFormat.PNG, 90, out);
                out.close();
                bmpUri = Uri.fromFile(file);

            } catch (IOException e) {
                e.printStackTrace();
            }

            String toNumber = "+919999999999";
            toNumber = toNumber.replace("+", "").replace(" ", "");
            Intent shareIntent =new Intent("android.intent.action.MAIN");
            shareIntent.setAction(Intent.ACTION_SEND);
            String ExtraText;
            ExtraText =  "Share Text";
            shareIntent.putExtra(Intent.EXTRA_TEXT, ExtraText);
            shareIntent.putExtra(Intent.EXTRA_STREAM, bmpUri);
            shareIntent.setType("image/jpg");
            shareIntent.setPackage("com.whatsapp");
            shareIntent.putExtra("jid", toNumber + "@s.whatsapp.net");
            shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
            try {

                startActivity(shareIntent);
            } catch (android.content.ActivityNotFoundException ex) {
                Toast.makeText(getBaseContext(), "Sharing tools have not been installed.", Toast.LENGTH_SHORT).show();
            }

        }

A: private void sendToContactUs() {
     String phoneNo="+918000874386";

    Intent sendIntent = new Intent("android.intent.action.MAIN");
    sendIntent.setAction(Intent.ACTION_VIEW);
    sendIntent.setPackage("com.whatsapp");
    String url = "https://api.whatsapp.com/send?phone=" + phoneNo + "&text=" + "Unique Code - "+CommonUtils.getMacAddress();
    sendIntent.setDataAndType(Uri.parse(url),"text/plain");

    if(sendIntent.resolveActivity(getPackageManager()) != null){
        startActivity(sendIntent);
    }else{
        Toast.makeText(getApplicationContext(),"Please Install Whatsapp Massnger App in your Devices",Toast.LENGTH_LONG).show();
    }
}

A:

 public void shareWhatsup(String text) {

        String smsNumber = "91+" + "9879098469"; // E164 format without '+' sign

        Intent intent = new Intent(Intent.ACTION_VIEW);

        try {
            String url = "https://api.whatsapp.com/send?phone=" + smsNumber + "&text=" + URLEncoder.encode(text, "UTF-8");
            intent.setPackage("com.whatsapp");
            intent.setData(Uri.parse(url));
        } catch (Exception e) {
            e.printStackTrace();
        }

        //    intent.setAction(Intent.ACTION_SEND);
        //   intent.setType("image/jpeg");
        //   intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUriArray);
        startActivity(intent);

    }

A: Instead of biasing to share the content to whats app.
Following code is a generic code that will give a simple solution using "ShareCompact" that android opens the list of apps that supports the sharing the content.
Here I am sharing the data of mime-type text/plain.
    String mimeType = "text/plain"
    String Message  = "Hi How are you doing?"

    ShareCompact.IntentBuilder
                .from(this)
                .setType(mimeType)
                .setText(Message)
                .startChooser()

A: Whatsapp and most other apps that integrate into the Android core components (like Contacts) use a mime-type based intent to launch a certain Activity within the application. Whatsapp uses 3 separate mimetypes - text messages (vnd.android.cursor.item/vnd.com.whatsapp.profile), voip calls (vnd.android.cursor.item/vnd.com.whatsapp.voip.call) and video calls(vnd.android.cursor.item/vnd.com.whatsapp.video.call). For each of these mimetypes, a separate activity is mapped inside the Manifest of the application. For ex: the mimetype (...whatsapp.profile) maps to an Activity (com.whatsapp.Conversation). You can see these in detail if you dump out all the Data rows that maps to any Whatsapp Raw_Contact in your Contacts database.
This is also how the Android Contacts app shows 3 separate rows of user action inside a "Whatsapp contact", and clicking either of these rows launches a separate function inside Whatsapp.
To launch a Conversation (chat) Activity for a certain contact in Whatsapp, you need to fire an intent containing MIME_TYPE and DATA_URL. The mimetype points to the mimetype corresponding to your action as defined inside Whatsapp's Raw Contact in Contacts database. The DATA_URL is the URI of the Raw_Contact in the Android contacts database.
String whatsAppMimeType = Uri.parse("vnd.android.cursor.item").buildUpon()
                                    .appendEncodedPath("vnd.com.whatsapp.profile").build().toString();

Uri uri = ContactsContract.RawContacts.CONTENT_URI.buildUpon()
        .appendQueryParameter(ContactsContract.RawContacts.ACCOUNT_TYPE, "com.whatsapp")
        .appendQueryParameter(ContactsContract.RawContacts.ACCOUNT_NAME, "WhatsApp")
        .build();

Cursor cursor = getContentResolver().query(uri, null, null, null);
if (cursor==null || cursor.getCount()==0) continue;

cursor.moveToNext();
int rawContactId = cursor.getInt(cursor.getColumnIndex(ContactsContract.RawContacts._ID));
cursor.close();

// now search for the Data row entry that matches the mimetype and also points to this RawContact
Cursor dataCursor = getContentResolver().query(ContactsContract.Data.CONTENT_URI,
        null,
        ContactsContract.Data.MIMETYPE + "=? AND " + ContactsContract.Data.RAW_CONTACT_ID + "=?",
        new String[]{whatsAppMimeType, String.valueOf(rawContactId)}, null);
if (dataCursor==null || dataCursor.getCount()==0) continue;

dataCursor.moveToNext();
int dataRowId = dataCursor.getInt(dataCursor.getColumnIndex(ContactsContract.Data._ID));

Uri userRowUri = ContactsContract.Data.CONTENT_URI.buildUpon()
                        .appendPath(String.valueOf(dataRowId)).build();

// launch the whatsapp user chat activity
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(userRowUri, whatsAppMimeType);
startActivity(intent);

dataCursor.close();

This is the same way that all Contacts app use to launch a chat Activity for a Whatsapp contact. Inside this Activity, the application (Whatsapp) reads in the .getData() to get the DATA_URI which was passed to this Activity. The Android Contacts app uses a standard mechanism to use the URI of the Raw Contact in Whatsapp. Unfortunately, I am not aware of a way by which the .Conversation ativity in Whatsapp reads in any text / data information from the caller of the intent. This basically means that its possible (using a very standard technique) to launch a certain "user action" inside Whatsapp. Or for that matter, any similar app.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Oracle Transaction - Count table I have a table where I need to constrain by category and then find all overlapping dates against some date range.  This takes about 2 seconds, which is unacceptable to do on every transaction which occurs at roughly 50/s.  The alternative is to create some tally table -- then again, I don't know how great of an idea this is because things can get out of sync.
Date on Rent   # Rented   Category
9/5/2011       5          CATEGORY1

In Oracle (PL/SQL, if it matters), how can I maintain this performance, but ensure that concurrent transactions don't screw up the increment / decrement by making it one less or one more than it really is?
I have two types of transactions, kind of like a search and a rent.  Only rents will be updating this tally table (and searches just reading from it).  I don't mind if rents slow down, but do not want search performance impacted.  Rents can occur as frequently as 5-10 / second.

A: Oracle uses locks to ensure data consistency during a query. The details of how they work can get complex, but the effect is that it guarantees that an update/insert to your tally table will only use the data in the main table as it was when the query began. If there is another update or insert to your main table while you are doing an update/insert to the tally table, it won't affect it.
You'll have to experiment with your data to see if keeping a summary/tally table helps or hurts you. It really depends on how quickly the main table is getting updated, how much time you spend updating your tally table vs how much time you save by being able to select on it, and how up-to-date you need selects to be.


Know Riverview High Class of 1962 graduates that are NOT on this List? Help us Update the 1962 Class List by adding missing names.
Contact Pat ennett-Hardesty for further info.
Please get in touch with Pat Bennett-Hardesty as soon as possible. We are having a great attendance and you do not want to be left out. Please call (941) 924-XXXX or send me a emailat *****@verizon.net and I will send you out info on the renion. Let me hear from you now.
Class of 1962 will be having a Reunion 24-25 of October 2014. Will be at Sun N'Fun, please contact Pat Bennett Hardesty at *****@verizon.net or phone (941) 924-XXXX . Our class have Reunions every 2 years now.
We are getting ready for our 55th Year Class Reunion. Have not set exact date but think will be Sept 2017. If you want to come to our Reunion, we need to hear from you, to make sure we have correct information to contact you.. My email is *****@verizon.net. Don't wait, don't want to miss all the fun we have together.
Our 55th Class Reunion is set Sept. 8 & 9,2017 at Sun N Fun Resort. Make your Reservation now to join in the fun. Contact Pat Bennett Hardesty to get details.
55th Class Reunion Class of 1962 will be Sept. 8 & 9, 2017. Contact Pat Bennett Hardesty to make Reservations.
Our 55th Class Reunion will be Sept 8 & 9,2017 at Sun N' Fun Resort, contact Pat Bennett Hardesty, and come join us sharing memories. My email *****@verizon.net.
Our Class had to cancel their 55th Reunion because of Hurricane Irma and is rescheduled for April 27 & 28,2018 at Sun N Fun Resort. If you are wanting to join us, please contact Pat Bennett Hardesty.
Class of 1962 just celebrated their 56th Reunion on April 27-28,2018. Was a great time by all that attended.
More 1962 alumni from Riverview HS Sarasota, FL have posted profiles on Classmates.com®. Click here to register for free at Classmates.com® and view other 1962 alumni.
Missing some friends from Riverview HS that graduated with you in 1962? Check the list below that shows the Riverview Sarasota, FL class of '62.


text:
Q: python sql magic issue with oracle 12.1.0.2.0 I follow the instruction to install sql magic.
https://github.com/catherinedevlin/ipython-sql
I got the following errors
/anaconda/lib/python3.6/site-packages/IPython/config.py:13: ShimWarning: The `IPython.config` package has been deprecated since IPython 4.0. You should import from traitlets.config instead.
  "You should import from traitlets.config instead.", ShimWarning)
/anaconda/lib/python3.6/site-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.
  warn("IPython.utils.traitlets has moved to a top-level traitlets package.")

It looks like its just warning so I move forward to  try to connect to the Oracle DB The version is 12.1.0.2.0
but still error out...
The end of the error stack:
/anaconda/lib/python3.6/site-packages/sqlalchemy/dialects/oracle/cx_oracle.py in <listcomp>(.0)
    707
    708         if hasattr(self.dbapi, 'version'):
--> 709             self.cx_oracle_ver = tuple([int(x) for x in
    710                                         self.dbapi.version.split('.')])
    711         else:

ValueError: invalid literal for int() with base 10: '0b2'

A: I cannot get sql magic to work but I find an easier solution.
Just do this
import pandas as pd
print(con.version)
query = """select * from all_tab_columns"""
df_ora = pd.read_sql(query, con=con)


But slam on the brakes, there is one catch. To be a Retread you must be at least 40-years-old. So, the size of your bike doesn't matter, but your age does! In fact, the Club's colorful, trademarked crest even celebrates their grown-up members with the words XL Plus, boldly printed in red.
With over 5,000 members, Retreads are located throughout the United States; the Canadian Provinces; The United Kingdom; and New Zealand.
The idea for the club started in 1969 by George Spidell, a Navy Chief Petty Officer; his main goal was to meet other mature riders from across the world. But seasoned members know that Retreads isn't just about older bikers.
Jim Mosley, the Colorado State Representative, and Retread member since 2008, says "this group promotes fellowship of motorcycle enthusiasts, so it doesn't matter what you ride." As the Club's website states, they are "a not-for-profit, socially oriented corporation." It's the social connections made through motorcycles that keeps members excited. Many of those special connections are made at international, regional and state Retread rallies and events.
For example, each year members participate in Retread bike rallies around the country. Here in Colorado, the local chapter (often referred to as the 'the loud ones') has ridden many miles, on stunning, picturesque roads to enjoy rallies around the country, including North Carolina, Pennsylvania, South Dakota, California, Utah, and Missouri. Mosley believes "being a Retread is about the fellowship and bonding with friends. I enjoy visiting with riders from all over the U.S. and Canada." In fact, one of his favorite stories is about meeting a Michigan rider at a rally in Hickory, North Carolina who was over 100-years-old!
There may be jokes about getting older. But it is no joke that Retreads ride hard, put on countless miles, and make strong, lasting friendships around the world.
This summer the Colorado Chapter is actively participating in two Retread Rallies.
From June 18-20, the Colorado Chapter hosts the Four Corners Regional Rally. Converging on Pueblo, Colorado for three days, riders will come from all over the U.S. Local chapter members are currently preparing for the rally. A beautiful ride to Bishop Castle (http://www.bishopcastle.org/) and an ice cream social are already planned!
At the end of July, the Colorado Chapter will journey to the Retread International Rally in Spearfish, South Dakota. Many of its 35 vintage members have already signed up to ride to the rally. Once there, new and old friendships will be cemented, and new and exciting roadways conquered. All are eager to experience South Dakota's scenic roads, full of natural wonders and unbelievable panoramic views.
For more information on Retread Rallies or Clubs: http://retreads.org/.


text:
← Latest medical evidence showing rising risk of social transmission of Covid-19 makes urgent case for schools to make mandatory wearing face coverings on school buses
COVID-19 and Your Rights as a Worker – UPDATED 25 September →
More detail needed on protections to workers offered by new UK government jobs support scheme
Posted on September 24, 2020 by Unite the union NI
Jackie Pollock, Unite Regional Secretary
Support announced means those working one-third of their usual hours will receive only 78 percent of their usual pay
Chancellor's announcement comes too late for many workers who have already lost their livelihoods due to uncertainty
Jackie Pollock Regional Secretary of Unite called for further clarification on the new job support scheme announced today by the Chancellor of the Exchequer, Rishi Sunak. He raised the question as to whether the new proposal effectively amounted to a 22 percent pay cut for some workers.
"Workers have been eagerly awaiting details of the government's plans for job support after the conclusion of the existing Coronavirus jobs retention scheme in October. There are particular concerns that without support, the economy in Northern Ireland faces a cliff-edge jobs threat.
"We face severe challenges from both the Covid-19 downturn and the continued uncertainty over post-Brexit trading relations. Our economy is uniquely exposed due to our geography and the importance of Aerospace, Aviation, Agri-Food and Tourism/Hospitality sectors which are particularly vulnerable. It is therefore vital that the UK government extend job support measures beyond October.
"Alongside the wider trade union movement, Unite has been engaging with government to secure such a commitment. It is unfortunate that today's announcement came too late for all those workers who have already unnecessarily and avoidably lost their livelihoods as a result of the total uncertainty which has existed until today.
"We are left with many questions about the Chancellor's job support package: how will this translate in reality when it comes to job security for workers in Northern Ireland? There appears to be nothing specific in terms of support for training and upskilling of those on short-term working and there is no commitment to raise the meagre statutory sick pay provision to enable workers to protect themselves and the public health without falling into poverty.
"Many workers will question whether this new measure by the Tories effectively amounts to a 22 percent pay cut. For those on short working of one-third of their usual hours, pay will fall to 78 percent of what it was previously and there is no clarity on the total wages of those working 50 percent of their normal hours. Unite will study the detail of this proposal and continue to engage with government both in London and Belfast to secure the support urgently needed by workers in Northern Ireland", Mr Pollock said.
This entry was posted in Northern Ireland news, Press Releases and tagged Chancellor of Exchequer, Covid-19, Jackie Pollock, job support package, Rishi Sunak. Bookmark the permalink.

redpajama_set_name: RedPajamaCommonCrawl


How to Find the Best Sewing Machine Buying a sewing machine is an investment that should not be underestimated. If you are considering buying a sewing machine for business purposes or for your own personal use, it is important that you ensure that you buy the best sewing machine the market can provide. Nevertheless, if you do not know where to start, this can get very complicated. However, you do not need to be discouraged. There are some tips that you can use when finding the best sewing machine in the market. The following suggestions will ensure that you find the best sewing machine in the market. Defining your needs should be the first thing that you have to do when looking for the best sewing machine in the market. There are many sewing machines on the market, with each machine having the capacity to produce a given quantity of work per unit time. When you specify your needs, you will be able to know which sewing machine is right for your king of needs. When defining your requirements, you need to consider the quantity of work you want to create per unit time, the cost of keeping the sewing machine, the speed at which the machine can work along with the ease of finding spare parts of the machine. This will make certain you purchase a sewing machine, which won't trouble you down the internet after you begin using it. The cost of the machine is also an important factor that you need to consider. Cost is directly proportional to the potential output of the sewing machine. After defining your needs, you need to come up with a budget estimate that you are willing to pay for a sewing machine. This will allow to be more specific when choosing a sewing machine with the best price for your needs. To add on this, when finding the best sewing machine, you should find one whose price do not strain your financial muscles too much. However, this is not a reason for you to get the cheapest sewing machine on the market. Remember that you will get what you pay for.


text:
Syros Pharmaceuticals Presents Data Demonstrating Significant Anti-Cancer Activity of SY-1425 in Preclinical Models of Acute Myeloid Leukemia
– Company on track to file IND and initiate Phase 2 study in mid-2016 in genomically defined subsets of AML and MDS patients identified by Syros' platform –
CAMBRIDGE, Mass.--(BUSINESS WIRE)-- Syros Pharmaceuticals today announced that SY-1425, a potent and selective retinoic acid receptor alpha (RARα) agonist, was observed to inhibit the growth of cancer cells and prolong survival in in vivo models of acute myeloid leukemia (AML) with a novel RARA biomarker discovered by the Company. The biomarker was found in approximately 25 percent of AML and myelodysplastic syndrome (MDS) patient tissue samples. These data were presented at the American Association of Cancer Research (AACR) Annual Meeting in New Orleans.
"SY-1425 represents a promising therapeutic option for novel genomically defined subsets of AML and MDS patients," said Nancy Simonian, MD, Chief Executive Officer of Syros. "Based on our preclinical data, which show a strong link between our biomarker and response to treatment with SY-1425, we are committed to rapidly advancing this first-in-class therapy for these currently underserved patients. Positive results from a Phase 2 clinical study would not only be beneficial to patients but also validate our pioneering approach of analyzing the non-coding region of DNA to advance the field of genomics-based medicine."
The data presented at AACR shows that the RARA biomarker discovered by Syros is predictive of response to treatment with SY-1425 in AML cell lines and patient-derived xenograft (PDX) models of AML. Treatment with SY-1425 was observed to inhibit cancer growth and prolong survival in PDX models of AML with the RARA biomarker but not in models of AML without the biomarker. Highlights of the data include:
Greatly reduced tumor burden in the blood, bone marrow and spleen in PDX mouse models with the RARA biomarker treated with SY-1425 compared to untreated mice; by contrast, no effect was seen in PDX models of AML without the biomarker.
Prolonged survival with 100 percent of mice with the RARA biomarker treated with SY-1425 alive at the end of the 35-day study; by contrast, none of the untreated mice survived beyond 25 days; also, by contrast, no survival benefit was seen in PDX models of AML without the biomarker.
Significant survival benefit in mice treated with SY-1425 compared to mice treated with ATRA, a pan-agonist of RARα, RARβ and RARAγ, in a PDX model with the RARA biomarker.
Using its gene control platform, Syros identified a specialized regulatory region of non-coding DNA known as a super-enhancer that is associated with the RARA gene in subsets of AML and MDS patients. The super-enhancer is believed to lock cells in an immature, proliferative state. Treatment with SY-1425 in cancer cells with the RARA super-enhancer appears to promote differentiation of these cells. Syros in-licensed SY-1425, which is approved in Japan as tamibarotene to treat acute promyelocytic leukemia, to develop and commercialize SY-1425 in North America and Europe for all cancers.
Syros plans to file an Investigational New Drug (IND) application with the U.S. Food and Drug Administration and initiate a Phase 2 clinical trial of SY-1425 in mid-2016 in subsets of AML and MDS patients with the RARA biomarker. The Company continues to research the role of the RARA super-enhancer in other cancers and plans to pursue additional indications upon achieving proof-of-concept in AML and MDS.
Syros Pharmaceuticals is pioneering the understanding of the non-coding region of the genome to advance a new wave of medicines that control expression of disease-driving genes. Syros has built a proprietary platform that is designed to systematically and efficiently analyze this unexploited region of DNA in human disease tissue to identify and drug novel targets linked to genomically defined patient populations. Because gene expression is fundamental to the function of all cells, the Company's gene control platform has broad potential to achieve profound and durable benefit across a range of diseases. Syros is focused on cancer and immune-mediated diseases and is advancing a growing pipeline, including its lead drug candidates SY-1425, a selective RARα agonist for genomically defined subsets of patients identified by its platform, for a range of cancers including acute myeloid leukemia and myelodysplastic syndrome, and SY-1365, a selective CDK7 inhibitor for a range of blood cancers and solid tumors. Led by a team with deep experience in drug discovery, development and commercialization, Syros is located in Cambridge, Mass.
Ten Bridge Communications, Inc.
Cara Mayfield, 845-392-3842
cara@tenbridgecommunications.com
Jesse Baumgartner, 212-362-1200
jesse@sternir.com