Setup and connection to an application