package edu.rpi.cs.yacs.core;

import android.app.Application;

import edu.rpi.cs.yacs.retrofit.ServiceHelper;
import io.realm.Realm;
import io.realm.RealmConfiguration;

/**
 * Created by Mark Robinson on 10/4/16.
 */
public class YACSApplication extends Application {
    private static YACSApplication instance;

    private ServiceHelper serviceHelper = null;
    private Realm realm = null;

    public static YACSApplication getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;

        serviceHelper = new ServiceHelper(getApplicationContext());

        RealmConfiguration realmConfiguration = new RealmConfiguration.Builder(this).build();
        Realm.setDefaultConfiguration(realmConfiguration);

        realm = Realm.getDefaultInstance();
    }

    public ServiceHelper getServiceHelper() {
        return serviceHelper;
    }

    public Realm getRealm() {
        return realm;
    }
}
@@ -57,16 +57,60 @@
 ation;%0A%0A
+import com.squareup.leakcanary.LeakCanary;%0A%0A
 import e
@@ -611,16 +611,208 @@
  this;%0A%0A
+        if (LeakCanary.isInAnalyzerProcess(this)) %7B%0A            // This process is dedicated to LeakCanary for heap analysis.%0A            return;%0A        %7D%0A%0A        LeakCanary.install(this);%0A%0A
         

Use LeakCanary In YACSApplication