static void createInstance(@NonNull Application application, @NonNull ApptentiveConfiguration configuration) {
		final String apptentiveKey = configuration.getApptentiveKey();
		final String apptentiveSignature = configuration.getApptentiveSignature();
		final String baseURL = configuration.getBaseURL();
		final boolean shouldEncryptStorage = configuration.shouldEncryptStorage();

		// set log message sanitizing
		ApptentiveLog.setShouldSanitizeLogMessages(configuration.shouldSanitizeLogMessages());

		// set log level before we initialize log monitor since log monitor can override it as well
		ApptentiveLog.overrideLogLevel(configuration.getLogLevel());

		// troubleshooting mode
		if (configuration.isTroubleshootingModeEnabled()) {
			// initialize log writer
			ApptentiveLog.initializeLogWriter(application.getApplicationContext(), LOG_HISTORY_SIZE);

			// try initializing log monitor
			LogMonitor.startSession(application.getApplicationContext(), apptentiveKey, apptentiveSignature);
		} else {
			ApptentiveLog.i(TROUBLESHOOT, "Troubleshooting is disabled in the app configuration");
		}

		synchronized (ApptentiveInternal.class) {
			if (sApptentiveInternal == null) {
				try {
					ApptentiveLog.i("Registering Apptentive Android SDK %s", Constants.getApptentiveSdkVersion());
					ApptentiveLog.v("ApptentiveKey=%s ApptentiveSignature=%s", apptentiveKey, apptentiveSignature);
					sApptentiveInternal = new ApptentiveInternal(application, apptentiveKey, apptentiveSignature, baseURL, shouldEncryptStorage);
					dispatchOnConversationQueue(new DispatchTask() {
						@Override
						protected void execute() {
							sApptentiveInternal.start();
						}
					});

					ApptentiveActivityLifecycleCallbacks.register(application);

				} catch (Exception e) {
					ApptentiveLog.e(e, "Exception while initializing ApptentiveInternal instance");
					logException(e);
				}
			} else {
				ApptentiveLog.w("Apptentive instance is already initialized");
			}
		}
	}
static void createInstance ( @ NonNull Application application , @ NonNull ApptentiveConfiguration configuration ) { final String apptentiveKey = configuration . getApptentiveKey ( ) ; final String apptentiveSignature = configuration . getApptentiveSignature ( ) ; final String baseURL = configuration . getBaseURL ( ) ; final boolean shouldEncryptStorage = configuration . shouldEncryptStorage ( ) ; ApptentiveLog . setShouldSanitizeLogMessages ( configuration . shouldSanitizeLogMessages ( ) ) ; ApptentiveLog . overrideLogLevel ( configuration . getLogLevel ( ) ) ; if ( configuration . isTroubleshootingModeEnabled ( ) ) { ApptentiveLog . initializeLogWriter ( application . getApplicationContext ( ) , LOG_HISTORY_SIZE ) ; LogMonitor . startSession ( application . getApplicationContext ( ) , apptentiveKey , apptentiveSignature ) ; } else { ApptentiveLog . i ( TROUBLESHOOT , "Troubleshooting is disabled in the app configuration" ) ; } synchronized ( ApptentiveInternal . class ) { if ( sApptentiveInternal == null ) { try { ApptentiveLog . i ( "Registering Apptentive Android SDK %s" , Constants . getApptentiveSdkVersion ( ) ) ; ApptentiveLog . v ( "ApptentiveKey=%s ApptentiveSignature=%s" , apptentiveKey , apptentiveSignature ) ; sApptentiveInternal = new ApptentiveInternal ( application , apptentiveKey , apptentiveSignature , baseURL , shouldEncryptStorage ) ; dispatchOnConversationQueue ( new DispatchTask ( ) { @ Override protected void execute ( ) { sApptentiveInternal . start ( ) ; } } ) ; ApptentiveActivityLifecycleCallbacks . register ( application ) ; } catch ( Exception e ) { ApptentiveLog . e ( e , "Exception while initializing ApptentiveInternal instance" ) ; logException ( e ) ; } } else { ApptentiveLog . w ( "Apptentive instance is already initialized" ) ; } } }
Create a new or return a existing thread-safe instance of the Apptentive SDK. If this
or any other {@link #getInstance()} has already been called in the application's lifecycle, the
App key will be ignored and the current instance will be returned.
<p/>
This will be called from the application's onCreate(), before any other application objects have been
created. Since the time spent in this function directly impacts the performance of starting the first activity,
service, or receiver in the hosting app's process, the initialization of Apptentive is deferred to the first time
{@link #getInstance()} is called.

@param application the context of the app that is creating the instance