Reputation: 13551
We are using Xamarin to develop mobile apps, and we are investigating what kind of interactions/integrations between two (Android) apps are possible. These are three scenarios we think of:
Using App Links it's easy to implement the Fire And Forget scenario. However, we are wondering whether the two other scenarios are possible with mobile apps:
Any idea if these two scenarios are possible in mobile apps, and how they can be achieved?
Upvotes: 1
Views: 111
Reputation: 1020
This should be done through the Intent-Filters and allowing another application to start your Activity. The basic idea is to create an Activity that any application could open through the Intent-Filter. Your Activity would launch over their application, do whatever the user needs to do, then close and return the results to your application.
When you install an application on Android, it will identify any intent-filters and place them in an internal catalog of all applications supported intents. This allows users to potentially pick between their favorite apps to do certain actions, but you can of course build something that works between only two applications.
Setting it up is covered in the documentation below, but the details really depend on what you are trying to do with your application. If you are trying to get a result, StartActivtyForResult can provide that. You might just want to use the Activity from another application that will log information on a server and not return a value. StartActivity can be used for this case as long as the Activity being brought up calls Finish() after doing whatever it needs to do. Otherwise you could be locked in another Activity. I hope this helps!
Documentation to help:
https://developer.android.com/training/app-indexing/deep-linking.html
https://developer.android.com/training/basics/intents/filters.html
Upvotes: 1