whatsapp Source code in android studio

How to send message on WhatsApp in Android

Whatsapp is the one of most popular messaging App. Many android applications need the functionality to share some messages directly from their app to WhatsApp. For example, if a user wants to share the app or share a message from the app then this functionality comes in use. Either user can send a text or a predefined text can also be sent through this. This article demonstrates how an android application can send messages on WhatsApp. Whatsapp must be installed on the user’s device.

activiti_main.xml

<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity"android:orientation="vertical"><!-- EditText to take message input from user--><EditTextandroid:id="@+id/message"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_margin="16dp"android:hint="Enter you message here"android:lines="8"android:inputType="textMultiLine"android:gravity="left|top"/><!-- Button to send message on Whatsapp--><Buttonandroid:id="@+id/submit"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_horizontal"android:text="Submit"android:background="@color/colorPrimary"android:textColor="@android:color/white"/></LinearLayout>

download