Data sharing between android apps

Asked

Viewed 336 times

3

I created an application that works as a calendar, where it is possible to register contacts with some more fields with respect to the schedules that comes preinstalled on the device.

My question is, is it possible to share the data registered with other applications, for example Whatsapp use the name of the registered contact (the registration of these contacts has a telephone field)? If it’s possible, as?

  • The data are recorded where?

  • In the sqlite bank

  • Does the kakamg0 answer go in the direction you want? If not explain better why I didn’t understand exactly what you want.

1 answer

4


Data can be shared with other installed applications using ACTION_SEND when you create a Intent.

You can do it this way:

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));

You can read more on Sending Simple Data to Other Apps and Whatsapp

It is also possible to add an item in the menu to share using Adding an Easy Share Action

  • Thank you, I help you a lot, but you don’t have my answer yet. I would have to send my bank to the Whats app whenever there is a registration, change or deletion? And yes I would have to do a select and send a ArrayList?

  • @I don’t think I understand your question. You want the user to be able to share a contact from your app to a conversation/group in Whats or that all contacts registered in your app are available for the user to open Whats and start a new conversation or add in a group?

  • all contacts registered in your app are available for the user to open Whats and start a new conversation or add in a group

  • The answer I put would be for the first case, so that the contacts in your app is available for Whats you must register them in the contact list of the phone. Whats reads your contact list and checks which ones are registered in Whats so you can use it within Whatsapp as described in FAQ.

  • To register your contacts on your phone you can use the https://stackoverflow.com/a/10204543 or https://stackoverflow.com/a/40147115 code or Modifying Contacts Using Intents

  • then I would have to register in my bank and use one of these to register in the user’s standard phone book?

  • Exactly, there when Whatsapp read the default user schedule it will recognize the numbers that are registered within Whatsapp and your contacts will be available to be used within the Whats.

  • Thank you. I think my app will not have this facility

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.