package com.orm;

public class SugarApp extends android.app.Application{

    private Database database;
    private static SugarApp sugarContext;

    public void onCreate(){
        super.onCreate();
        SugarApp.sugarContext = this;
        this.database = new Database(this);
    }

    public void onTerminate(){
        if (this.database != null) {
            this.database.getDB().close();
        }
        super.onTerminate();
    }

    public static SugarApp getSugarContext(){
        return sugarContext;
    }

    protected Database getDatabase() {
        return database;
    }
}

@@ -276,32 +276,266 @@
 e(this);%0A    %7D%0A%0A
+    /*%0A     * Per issue #106 on Github, this method won't be called in%0A     * any real Android device. This method is used purely in%0A     * emulated process environments such as an emulator or%0A     * Robolectric Android mock.%0A     */%0A
     public void 

Add documentation on onTerminate to clarify usage scenarios Closes #106