sdk/src/main/java/com/bugsnag/android/Client.java
@NonNull
    private static Configuration createNewConfiguration(@NonNull Context androidContext,
                                                        String apiKey,
                                                        boolean enableExceptionHandler) {
        Context appContext = androidContext.getApplicationContext();

        // Attempt to load API key and other config from AndroidManifest.xml, if not passed in
        boolean loadFromManifest = TextUtils.isEmpty(apiKey);

        if (loadFromManifest) {
            try {
                PackageManager packageManager = appContext.getPackageManager();
                String packageName = appContext.getPackageName();
                ApplicationInfo ai =
                    packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
                Bundle data = ai.metaData;
                apiKey = data.getString(MF_API_KEY);
            } catch (Exception ignore) {
                Logger.warn("Bugsnag is unable to read api key from manifest.");
            }
        }

        if (apiKey == null) {
            throw new NullPointerException("You must provide a Bugsnag API key");
        }

        // Build a configuration object
        Configuration newConfig = new Configuration(apiKey);
        newConfig.setEnableExceptionHandler(enableExceptionHandler);

        if (loadFromManifest) {
            try {
                PackageManager packageManager = appContext.getPackageManager();
                String packageName = appContext.getPackageName();
                ApplicationInfo ai =
                    packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
                Bundle data = ai.metaData;
                populateConfigFromManifest(newConfig, data);
            } catch (Exception ignore) {
                Logger.warn("Bugsnag is unable to read config from manifest.");
            }
        }
        return newConfig;
    }
/**
     * Creates a new configuration object based on the provided parameters
     * will read the API key and other configuration values from the manifest if it is not provided
     *
     * @param androidContext         The context of the application
     * @param apiKey                 The API key to use
     * @param enableExceptionHandler should we automatically handle uncaught exceptions?
     * @return The created config
     */
Creates a new configuration object based on the provided parameters
will read the API key and other configuration values from the manifest if it is not provided

@param androidContext         The context of the application
@param apiKey                 The API key to use
@param enableExceptionHandler should we automatically handle uncaught exceptions.
@return The created config
Creates a new configuration object based on the provided parameters will read the API key and other configuration values from the manifest if it is not provided @param androidContext The context of the application @param apiKey The API key to use @param enableExceptionHandler should we automatically handle uncaught exceptions . @return The created config
@NonNull
    private static Configuration createNewConfiguration(@NonNull Context androidContext,
                                                        String apiKey,
                                                        boolean enableExceptionHandler) {
        Context appContext = androidContext.getApplicationContext();
        boolean loadFromManifest = TextUtils.isEmpty(apiKey);
        if (loadFromManifest) {
            try {
                PackageManager packageManager = appContext.getPackageManager();
                String packageName = appContext.getPackageName();
                ApplicationInfo ai =
                    packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
                Bundle data = ai.metaData;
                apiKey = data.getString(MF_API_KEY);
            } catch (Exception ignore) {
                Logger.warn("Bugsnag is unable to read api key from manifest.");
            }
        }
        if (apiKey == null) {
            throw new NullPointerException("You must provide a Bugsnag API key");
        }
        Configuration newConfig = new Configuration(apiKey);
        newConfig.setEnableExceptionHandler(enableExceptionHandler);
        if (loadFromManifest) {
            try {
                PackageManager packageManager = appContext.getPackageManager();
                String packageName = appContext.getPackageName();
                ApplicationInfo ai =
                    packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
                Bundle data = ai.metaData;
                populateConfigFromManifest(newConfig, data);
            } catch (Exception ignore) {
                Logger.warn("Bugsnag is unable to read config from manifest.");
            }
        }
        return newConfig;
    }
@ NonNull private static Configuration createNewConfiguration ( @ NonNull Context androidContext , String apiKey , boolean enableExceptionHandler ) { Context appContext = androidContext . getApplicationContext ( ) ; boolean loadFromManifest = TextUtils . isEmpty ( apiKey ) ; if ( loadFromManifest ) { try { PackageManager packageManager = appContext . getPackageManager ( ) ; String packageName = appContext . getPackageName ( ) ; ApplicationInfo ai = packageManager . getApplicationInfo ( packageName , PackageManager . GET_META_DATA ) ; Bundle data = ai . metaData ; apiKey = data . getString ( MF_API_KEY ) ; } catch ( Exception ignore ) { Logger . warn ( "Bugsnag is unable to read api key from manifest." ) ; } } if ( apiKey == null ) { throw new NullPointerException ( "You must provide a Bugsnag API key" ) ; } Configuration newConfig = new Configuration ( apiKey ) ; newConfig . setEnableExceptionHandler ( enableExceptionHandler ) ; if ( loadFromManifest ) { try { PackageManager packageManager = appContext . getPackageManager ( ) ; String packageName = appContext . getPackageName ( ) ; ApplicationInfo ai = packageManager . getApplicationInfo ( packageName , PackageManager . GET_META_DATA ) ; Bundle data = ai . metaData ; populateConfigFromManifest ( newConfig , data ) ; } catch ( Exception ignore ) { Logger . warn ( "Bugsnag is unable to read config from manifest." ) ; } } return newConfig ; }
Creates a new configuration object based on the provided parameters
 will read the API key and other configuration values from the manifest if it is not provided
Creates a new configuration object based on the provided parameters will read the API key and other configuration values from the manifest if it is not provided
// Attempt to load API key and other config from AndroidManifest.xml, if not passed in // Build a configuration object