Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Communication between two applications

Is it possible to communicate between two different applications, one running in background and the other in foreground? If yes, can anyone suggest how?

like image 712
zahreelay Avatar asked May 15 '12 19:05

zahreelay


People also ask

How do two applications communicate?

At the simplest level, there are two different ways for apps to interact on Android: via intents, passing data from one application to another; and through services, where one application provides functionality for others to use.

What is application communication?

Communicating with Applications (Application to Application Communication) Your application can communicate with another application that runs in a virtual machine on the same system as your application, on a different z/VM system, or within a Systems Network Architecture (SNA) defined network.

Do apps talk to each other?

So how do apps ​“talk” to each other? An application programming interface (API) is an interface provided by an app that allows third parties to use it to extend their own functionality. In layman's terms, it means APIs allow programmers to connect to other websites or apps to enhance their own.

How do I communicate between two applications in Linux?

shared memory and message queues can be used to exchange information between processes. The difference is in how they are used. both have some advantage and disadvantage. it's an area of storage that can be read and written by more than one process.


2 Answers

Yes Communication can be made between two applications in iPhone but limited to a handful of scenarios.

  1. There might be apps which need to be sending to background according to some event like phonecall,etc.In Such cases you will have to configure your audio-session object (a Voip based app) and send notification accordingly.

  2. The previous example is just interacting between apps with extremely less flexibility(sending app to background on some important built in event).The other way to do this is through URL Schemes , apple has some built in functionality and support for certain applications such as mail.tel , etc.But one of the application will come to foreground.

Like you can call a phone number , which is built in application using :-

NSString *phURL= [NSString stringWithFormat:@"tel:%@", [NSString StringWithString:@"1-800-555-1212"]];
NSURL *phoneURL = [NSURL URLWithString:phURL];
[[UIApplication sharedApplication] openURL:phoneURL]];

By the way it's along story if You need to implement a Custom URL Schemes..have fun with it.

  1. The other way is through UIDocumentInteractionController which provides in-app support to have interaction between certain files.(Sandbox environment inhibits a complete access or even accesses that can modify data of other application).Like it can be used to preview files in mail app or download attachments.But you cannot modify them for other application , of course you can copy it and modify it for your application.
like image 138
Abhishek Singh Avatar answered Oct 10 '22 06:10

Abhishek Singh


I don't think this is exactly what you want, but it will definitely allow you to interact between the applications.

https://developer.apple.com/library/IOs/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW18

Its just using URL schemes to activate a command and open in another application. Just try to avoid using the apple defaults for your own application.

like image 32
RileyE Avatar answered Oct 10 '22 07:10

RileyE