Skip to main content

Sharing Simple Data In Android

As a Android developer, you might want to integrate android apps with each other. Do you know how that functions?  Do you possess knowledge about the way in which they communicate?  If no, then for your reference, Android apps possess the ability to integrate as well as communicate with each other. There are ways in which simple data can be sent and received between applications. This can be done by using Intent APIs and the ActionProvider object.
In this article we will cover three ways to share simple data.
  1. Sending Simple Data to Other Apps
  2. Receiving Simple Data from Other Apps
  3. Adding an Easy Share Action

1. Sending Simple Data to Other Apps

Sending & receiving data between apps is one of the most common uses of Intent. It allows for easy and quick sharing of information. One thumb rule to remember is that while constructing an Intent, it is imperative that you specify the action you want it to trigger. There are numerous actions. This includes ACTION_SEND. This indicates that the Intent will send data from one activity to another.
To send data to another activity, we need to specify the data and its type.
Uses of ACTION_SEND
  1. Send Text Content
  2. Send Binary Content
  3. Send Multiple Pieces of Content

1) Send Text Content

Here we use ACTION_SEND action to send text content from one activity to another.
Example:
If there will be any installed application with a filter that matches ACTION_SEND and MIME type text/plain, the Android system will run it. Additionally, if more than one application matches, the Android system displays a dialog or we can say a “chooser” which will allow a user to choose an app.
However, if we call Intent.createChooser(), passing it Intent object, it will always display the chooser.
Example :

Comments

Popular posts from this blog

Handle Scrollable Views or Controls in another Scrollview in Android

In life of any Android developer, there are times when there is a requirement in the application to use one scrollable control inside another scrollable control. In such cases, the scrolling functionality of one or all scrollable controls gets enabled and the Android application cannot identify that scroll event of which control is to be handled first. Here, UI may get stuck in some scenarios. The ideal behavior expected is when the user touches the parent scroll view, only the parent view’s scroll event is called and when the user scrolls the child scroll view, the child view’s scroll event is called. In our standard Android application development and implementation process it does not happen when we add scrollable control in another scrollable control. Below is the solution to handle the scroll event of both the controls without any glitch. Example We have a layout that has a ScrollView as parent layout and it contains some TextViews, ImageViews and ListView as child control...
Android Push Notification Using Firebase Cloud Messaging In this tutorial, I’m gonna show you how to use the push notifications in your android applications. Before the Google I/O 2016 , we were using the Google Cloud Messaging service (GCM) to send the data from the server to the clients or the android power devices but in I/O 2016, Google introduced the Firebase Cloud Messaging which is a good alternative and easier to implement. Steps to implement FireBase push notification in Android 1: Import the code of FCM   https://drive.google.com/a/edreamz.in/file/d/0B1L0RecNhNk9UDhhOXRZQjJYU0k/view?usp=sharing 2: go to    https://console.firebase.google.com/  and create a new project. 4: Now put your app name and select your country. 5: Now click on Add Firebase to Your Android App. 6: Now you have to enter your projects package name and click on ADD APP. 7:After clicking add app you will get google-services.json fil...
Android Push Notification Using Firebase Cloud Messaging In this tutorial, I’m gonna show you how to use the push notifications in your android applications. Before the Google I/O 2016 , we were using the Google Cloud Messaging service (GCM) to send the data from the server to the clients or the android power devices but in I/O 2016, Google introduced the Firebase Cloud Messaging which is a good alternative and easier to implement. Steps to implement FireBase push notification in Android 1: Import the code of FCM   https://drive.google.com/a/edreamz.in/file/d/0B1L0RecNhNk9UDhhOXRZQjJYU0k/view?usp=sharing 2: go to    https://console.firebase.google.com/  and create a new project. 4: Now put your app name and select your country. 5: Now click on Add Firebase to Your Android App. 6: Now you have to enter your projects package name and click on ADD APP. 7:After clicking add app you will get google-services.json fil...