app/src/main/java/fr/free/nrw/commons/CommonsApplication.java
@Override
    public void onCreate() {
        super.onCreate();
        if (BuildConfig.DEBUG) {
            //FIXME: Traceur should be disabled for release builds until error fixed
            //See https://github.com/commons-app/apps-android-commons/issues/1877
            Traceur.enableLogging();
        }

        ApplicationlessInjection
                .getInstance(this)
                .getCommonsApplicationComponent()
                .inject(this);

        initTimber();

//        Set DownsampleEnabled to True to downsample the image in case it's heavy
        ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
                .setDownsampleEnabled(true)
                .build();
        try {
            Fresco.initialize(this, config);
        } catch (Exception e) {
            Timber.e(e);
            // TODO: Remove when we're able to initialize Fresco in test builds.
        }

        // Empty temp directory in case some temp files are created and never removed.
        ContributionUtils.emptyTemporaryDirectory();

        initAcra();
        if (BuildConfig.DEBUG) {
            Stetho.initializeWithDefaults(this);
        }

        createNotificationChannel(this);


        if (setupLeakCanary() == RefWatcher.DISABLED) {
            return;
        }
        // Fire progress callbacks for every 3% of uploaded content
        System.setProperty("in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD", "3.0");
    }
/**
     * Used to declare and initialize various components and dependencies
     */
Used to declare and initialize various components and dependencies
Used to declare and initialize various components and dependencies
@Override
    public void onCreate() {
        super.onCreate();
        if (BuildConfig.DEBUG) {
            Traceur.enableLogging();
        }
        ApplicationlessInjection
                .getInstance(this)
                .getCommonsApplicationComponent()
                .inject(this);
        initTimber();
        ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
                .setDownsampleEnabled(true)
                .build();
        try {
            Fresco.initialize(this, config);
        } catch (Exception e) {
            Timber.e(e);
        }
        ContributionUtils.emptyTemporaryDirectory();
        initAcra();
        if (BuildConfig.DEBUG) {
            Stetho.initializeWithDefaults(this);
        }
        createNotificationChannel(this);
        if (setupLeakCanary() == RefWatcher.DISABLED) {
            return;
        }
        System.setProperty("in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD", "3.0");
    }
@ Override public void onCreate ( ) { super . onCreate ( ) ; if ( BuildConfig . DEBUG ) { Traceur . enableLogging ( ) ; } ApplicationlessInjection . getInstance ( this ) . getCommonsApplicationComponent ( ) . inject ( this ) ; initTimber ( ) ; ImagePipelineConfig config = ImagePipelineConfig . newBuilder ( this ) . setDownsampleEnabled ( true ) . build ( ) ; try { Fresco . initialize ( this , config ) ; } catch ( Exception e ) { Timber . e ( e ) ; } ContributionUtils . emptyTemporaryDirectory ( ) ; initAcra ( ) ; if ( BuildConfig . DEBUG ) { Stetho . initializeWithDefaults ( this ) ; } createNotificationChannel ( this ) ; if ( setupLeakCanary ( ) == RefWatcher . DISABLED ) { return ; } System . setProperty ( "in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD" , "3.0" ) ; }
Used to declare and initialize various components and dependencies
Used to declare and initialize various components and dependencies
//FIXME: Traceur should be disabled for release builds until error fixed //See https://github.com/commons-app/apps-android-commons/issues/1877 //        Set DownsampleEnabled to True to downsample the image in case it's heavy // TODO: Remove when we're able to initialize Fresco in test builds. // Empty temp directory in case some temp files are created and never removed. // Fire progress callbacks for every 3% of uploaded content