HostInfo


public final class HostInfo


Container class for information about the host the app is connected to.

Apps can use this information to determine how they will respond to the host. For example, a host which is not recognized could receive a message screen while an authorized host could receive full access to the app's capabilities.

The package name and uid can used to query the system package manager for a signature or to determine if the host has a system signature.

The host API level can be used to adjust the models exchanged with the host to those valid for the specific host version the app is connected to.

Summary

Public constructors

HostInfo(@NonNull String packageName, int uid)

Constructs an instance of the HostInfo from the required package name, UID and API level.

Public methods

@NonNull String

Returns the package name of the host.

int

Returns the UID of the host.

@NonNull String

Public constructors

HostInfo

Added in 1.0.0
public HostInfo(@NonNull String packageName, int uid)

Constructs an instance of the HostInfo from the required package name, UID and API level.

Public methods

getPackageName

Added in 1.0.0
public @NonNull String getPackageName()

Returns the package name of the host.

getUid

Added in 1.0.0
public int getUid()

Returns the UID of the host.

toString

public @NonNull String toString()