Is it possible to communicate between two different applications, one running in background and the other in foreground? If yes, can anyone suggest how?
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.
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.
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.
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.
Yes Communication can be made between two applications in iPhone but limited to a handful of scenarios.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With