Passing a file back and forth between two apps on the same device is possible but has several issues:
1. If you hard code the directory and file name to avoid manual intervention, things might break in the future.
2. Google Android may take away features in the future. It is apparently already not happy with the solution suggested above.
3. There is an issue as to how to handle the hand-shake between the two apps.
For instance, what if you don't process the last text file with app 'B' before creating or writing over the text file with a new entry from 'A'
The approach to syncing databases provided by Erel for your own web server in:
RDC is a middleware server that makes it simple to safely connect clients and remote SQL database servers. jRDC2 is the latest version. All new projects should use this version. jRDC2 is made of two components: - B4J server. The server receives the requests from the clients, issues the SQL...
www.b4x.com
or my adaptation of it for a 'hosted server" in:
My need was to sync calendars in which user 'A' changes the calendar and sends the change to other users by writing records to the hosted database. The other users query periodically to see it they have any incoming sync records and read them if available. I had hoped to use Erel's JDRC2...
www.b4x.com
each give you another option that you might use to pass data between different apps on the same device.
Both of these were built to pass DB update transactions between the same app on different devices.
They both use a remote server to store the transaction until it can be read by the app on the other devices. However, there is no reason that it can't be different apps on the same device. As to speed, I have seen my apps read 150 records and update the database in under a second, so your single record will be no problem. You can update a DB or just use the record to process your next step.
In my example, you:
1. Define a 'group Id' and 'Individual Id'. In your case, this would be a unique Id for the device and individual ids, 'A', 'B', and 'C'. You would save the same 'group Id' into each app for the particular device; you could even use the phone number as the 'group-id'. The apps would also store their 'individual Id': 'A', 'B', or 'C'.
2. Outgoing transactions send their data to the server using a prebuilt https command and are sent to each of the 'Individual Ids' for the 'Group Id'. In your case 'A' would send to 'B' and 'C'.
3. When 'B' becomes active, it issues an https command to read any transactions intended for it.
4. When the result has been received and successfully processed, it sends another https command to delete the entry.
5. Ditto for 'C'.
The documentation provided discusses:
1. How to build the php routines for the hosted server.
2. How to make the http calls.
3. Approach to buffering the output to handle a situation where the communication link is temporarily lost during the 'send' operation.
4. Approach to assuring the data is not lost if there is interruption during the download.
5. Eliminating SQL injection issues.
In addition, you will have to decide how to 'fire' the https read operation in 'B' and 'C'. This could be as simple as firing it at load time in starter or b4xmainpage; firing it at ' B4xPage_Appear' time, or even adding a button to 'Read transaction'.
Good luck with your project.
Cliff McKibbin