A remote application control (app control) is a way of interacting with a remote application installed on a remote host device. The remote app control can be used to invoke or launch a remote application explicitly or implicitly based on the available information, such as operation, application package name, and URI, and to receive a reply from the remote device's launched application.
The remote application can be launched in 2 ways, after you have created a remote application control object:
Explicit launch: The remote application can be launched by explicitly defining the package and application name of the remote application in the app control request.
Implicit launch: The remote application can be launched implicitly by defining the operation and URI of the remote application in the app control request.
You can use either of the launch methods, based on the available knowledge of remote application attributes, such as the package name, application name, operation, and URI. You can also retrieve the remote application attribute values, if needed.
To use the methods and properties of the RemoteAppControl classes, include the Samsung.RemoteAppControl namespace in your application:
using Samsung.RemoteAppControl;
Creating Remote App Control Object
Create RemoteAppControl to be used for the communication:
RemoteAppControl remoteAppControl = new RemoteAppControl();
Launching a Remote Application Explicitly
If you know the remote application package and application names, you can use the explicit launch method, and you do not need to define the operation. The explicit launch is currently supported on the Android platform.
Set the Package instance
The package name of the remote device to explicitly launch. The package name must be set to the remote application control handle.
remoteAppControl.Package = "com.your.package";
Set the ApplicationId instance
The application identifier of the remote device to explicitly launch. The application name must be set to the remote application control handle.
The data which will be sent to the remote application. The caller application can set additional private string data, which is sent to the remote application and can be processed by the remote application.
remoteAppControl.Data = "some string data";
Define the remote reply callback(RemoteAppControlReplyCallback), if needed.
If the caller application wants to receive a reply from the launched remote application, it must register a callback function under the remote application control handle. When the remote application sends a reply, the callback is executed.
Launch the remote application explicitly with the remote application control handle.
Once the required handle attributes are set, use the SendLaunchRequest() function to launch the remote application.
If you know the operation and URI registered by the remote application, you can use the implicit launch method. The implicit launch does not support sending results back from the launched remote application, and you cannot send any extra data to the remote application.
Set the Operation instance.
The operation must be set to the remote application control handle. Currently, the OPERATION_VIEW operation is supported to launch the remote application with a URI.
Launch the remote application implicitly with the remote application control handle.
Once the required handle attributes are set, use the SendLaunchRequest() function to launch the remote application.
Retrieving Remote Application Control Attribute Values
The remote application control can hold various attributes, and you can access their values from the remote application control handle instance
Operation: Action to be performed by the remote application control
URI: URI data for launching the remote application
ApplicationId: Activity name of the remote application
Package: Package name of the remote application
Data: Additional information for the launch request and the result of the request
string operation = remoteAppControl.Operation;
string uri = remoteAppControl.Uri;
string applicationId = remoteAppControl.ApplicationId;
string package = remoteAppControl.Package;
string data = remoteAppControl.Data;
Developing the Remote Android Application
When you develop a remote Android host application that can be launched through remote application control requests, you must take the following remote application control features into account:
The host application Android Activity receives data when it is explicitly launched through a remote application control.
The following table lists the information data received by Android Activity. The information applies to explicit launches only.
Table: Data received by the host application
Key
Description
remote_device_id
Bluetooth/Wi-Fi address of the remote device
remote_app_id
Application ID of the caller application on a Galaxy Watch device that invoked the launch request
remote_extra_data
Extra data explicitly added by the caller application on the Galaxy Watch device that invoked the launch request
Galaxy Watch App can launch Android Activity to send data to the Android Host App.
Android app can receive the data using getIntent() method and can determine if this data is required by the caller application.
To receive the String sent from Galaxy Watch App, you can use intent object's getStringExtra() method.
The Android host application can send a reply result back to the Galaxy Watch application that initiated an explicit launch request.
Use the getCallingActivity() Android method to determine whether a reply is required by the caller application.
When sending the reply, you can add extra data on the intent data object:
Intent newintent = new Intent();
newintent.putExtra("remote_extra_data", data);
setResult(RESULT_OK, newintent);
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.