U
U
UxName2016-03-23 15:19:39
Java
UxName, 2016-03-23 15:19:39

What is the easiest way to organize data exchange between two Android applications?

The data passed is simple: app1 sends a string to app2, and app2 needs to return another string to app1. What is the best way to do this?
I tried to do it through sendOrderedBroadcast - a problem arises, on some phones, when application2 is closed (namely, the receiver is located in it), application1 cannot start the receiver in application2. Even if I point

intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);

Perhaps this clarification will be useful: I am making a translator consisting of two applications, the first contains an interface, the second contains a dictionary. From the first to the second, you need to transfer the word and get the translation. Everything is in the form of a String.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Zagaevsky, 2016-03-23
@uxname

As gadfi said , you need to use an exported ContentProvider on your dictionary. A Cursor can be created as a MatrixCursor if you don't have a database that provides a cursor.

O
Oleg Gamega, 2016-03-23
@gadfi

ContentProvider to help you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question