Create and initialize SMPClientConnection.
The SMPClientConnection class declares the programmatic interface for an object that manages connection settings required for registering the user and fetching application settings from the server. An SMPClientConnection object has to be initialized and connection properties has to be set on this object before performing any type of user onboarding or before fetching any application settings from the server.
The following code illustrates how to initialize an application:
public ClientConnection(Context context, String appID, String Domain, String securityConfig, SDMRequestManager requestManager)
public static SDMLogger logger; public static SDMPreferences pref; public static SDMConnectivityParameters param; public static SDMRequestManager reqMan; logger = new SDMLogger(); pref = new SDMPreferences(c, logger); pref.setBooleanPreference(ISDMPreferences.SDM_PERSISTENCE_SECUREMODE, false); pref.setIntPreference(ISDMPreferences.SDM_CONNECTIVITY_HTTPS_PORT, 443); pref.setIntPreference(ISDMPreferences.SDM_CONNECTIVITY_CONNTIMEOUT, 70000); pref.setIntPreference(ISDMPreferences.SDM_CONNECTIVITY_SCONNTIMEOUT, 70000); param = new SDMConnectivityParameters(); param.setUserName(<username>); param.setUserPassword(<password>); reqMan = new SDMRequestManager(logger, pref, param, 1); ClientConnection clientConnection = new ClientConnection(getApplicationContext(), “NewFlight”, “default”, “SSO”, reqMan);
pref.setStringPreference(ISDMPreferences.SDM_CONNECTIVITY_HANDLER_CLASS_ NAME, SDMConstants.SDM_HTTP_HANDLER_CLASS);