How to share app data with other applications in android?

AndroidMobile DevelopmentApps/Applications

In android using implicit intent, we can send data with other applications using ACTION_SEND action. We have to call Intent.createChooser() to open default chooser of android mobile to send the data. it may same or different in Android mobiles.

This example demonstrates how to share app data with other applications in android.

Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.

Step 2 − Add the following code to res/layout/activity_main.xml.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""
      android:layout_height="wrap_content" />

In the above code, it contains textview, when user clicks on text view it going to send textview data with other applications.

Step 3 − Add the following code to src/

package com.example.andy.myapplication;
import android.annotation.TargetApi;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
   public int counter;
   protected void onCreate(Bundle savedInstanceState) {
      final TextView textView = findViewById(;
      textView.setOnClickListener(new View.OnClickListener() {
         public void onClick(View v) {
            Intent i = new Intent();
            i.putExtra(android.content.Intent.EXTRA_TEXT, textView.getText().toString());
            startActivity(Intent.createChooser(i, "Share to"));

In the above code contains textview, when you click on textview, it going to send the data using intent.

Step 4 − No need to change of manifest.xml file

Let's try to run your application. I assume you have connected your actual Android Mobile device with your computer. To run the app from an android studio, open one of your project's activity files and click Run Icon  from the toolbar. Select your mobile device as an option and then check your mobile device which will display your default screen −

This is an initial screen when you click on it will open default chooser from your Android device as shown below -

Select any on application to send the data through that application. Either we can send the data for one person or post the data on your wall, it depends on chooser applications.

Click here to download the project code

Updated on 30-Jul-2019 22:30:24