// Path: app/src/main/java/com/habitissimo/vespapp/Vespapp.java
// public class Vespapp extends Application {
//     private static final boolean FORCE_MOCK = false;
//     private Database database;
//     private VespappApi api;
//     private Gson gson;
//     private OkHttpClient httpClient;
// 
//     public static Vespapp get(Context context) {
//         return (Vespapp) context.getApplicationContext();
//     }
// 
//     private void setStrictModeConfigurationWorkaround() {
//         //Workaround for modifying StrictMode parameters.
//         //See http://code.google.com/p/android/issues/detail?id=35298
//         new Handler().postAtFrontOfQueue(new Runnable() {
//             @Override public void run() {
//                 setStrictModeConfiguration();
//             }
//         });
//     }
// 
//     private void setStrictModeConfiguration() {
//         StrictMode.ThreadPolicy policy;
//         policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
//         StrictMode.setThreadPolicy(policy);
//     }
// 
//     @Override public void onCreate() {
//         setStrictModeConfiguration();
//         super.onCreate();
//         setStrictModeConfigurationWorkaround();
// 
//         Iconify.with(new FontAwesomeModule());
// 
//         gson = new Gson();
//         database = new Database(this, gson);
//         httpClient = new OkHttpClient.Builder()
//                 .build();
//         Picasso.setSingletonInstance(new Picasso.Builder(this)
//                 .listener(new Listener() {
//                     @Override public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) {
//                         Log.d("Picasso", "Image failed loading: " + exception);
//                     }
//                 })
//                 .build());
// 
//         if (Constants.isBaseApiUrlDefined() && !FORCE_MOCK) {
//             Retrofit retrofit = new Builder()
//                     .baseUrl(Constants.API_BASE_URL)
//                     .addConverterFactory(GsonConverterFactory.create(gson))
//                     .client(httpClient)
//                     .build();
//             api = retrofit.create(VespappApi.class);
//         }
//     }
// 
//     public Database getDatabase() {
//         return database;
//     }
// 
//     public VespappApi getApi() {
//         if (api == null)
//             throw new RuntimeException("Constants.API_BASE_URL is not defined");
// 
//         return api;
//     }
// }


import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import com.google.gson.Gson;
import com.habitissimo.vespapp.Vespapp;
package com.habitissimo.vespapp.database;



public class Database {
    private SharedPreferences preferences;
    private Gson gson;

    public Database(Context context, Gson gson) {
        this.gson = gson;
        preferences = context.getSharedPreferences("database", Context.MODE_PRIVATE);
    }

    public static Database get(Context context) {
// Path: app/src/main/java/com/habitissimo/vespapp/Vespapp.java
// public class Vespapp extends Application {
//     private static final boolean FORCE_MOCK = false;
//     private Database database;
//     private VespappApi api;
//     private Gson gson;
//     private OkHttpClient httpClient;
// 
//     public static Vespapp get(Context context) {
//         return (Vespapp) context.getApplicationContext();
//     }
// 
//     private void setStrictModeConfigurationWorkaround() {
//         //Workaround for modifying StrictMode parameters.
//         //See http://code.google.com/p/android/issues/detail?id=35298
//         new Handler().postAtFrontOfQueue(new Runnable() {
//             @Override public void run() {
//                 setStrictModeConfiguration();
//             }
//         });
//     }
// 
//     private void setStrictModeConfiguration() {
//         StrictMode.ThreadPolicy policy;
//         policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
//         StrictMode.setThreadPolicy(policy);
//     }
// 
//     @Override public void onCreate() {
//         setStrictModeConfiguration();
//         super.onCreate();
//         setStrictModeConfigurationWorkaround();
// 
//         Iconify.with(new FontAwesomeModule());
// 
//         gson = new Gson();
//         database = new Database(this, gson);
//         httpClient = new OkHttpClient.Builder()
//                 .build();
//         Picasso.setSingletonInstance(new Picasso.Builder(this)
//                 .listener(new Listener() {
//                     @Override public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) {
//                         Log.d("Picasso", "Image failed loading: " + exception);
//                     }
//                 })
//                 .build());
// 
//         if (Constants.isBaseApiUrlDefined() && !FORCE_MOCK) {
//             Retrofit retrofit = new Builder()
//                     .baseUrl(Constants.API_BASE_URL)
//                     .addConverterFactory(GsonConverterFactory.create(gson))
//                     .client(httpClient)
//                     .build();
//             api = retrofit.create(VespappApi.class);
//         }
//     }
// 
//     public Database getDatabase() {
//         return database;
//     }
// 
//     public VespappApi getApi() {
//         if (api == null)
//             throw new RuntimeException("Constants.API_BASE_URL is not defined");
// 
//         return api;
//     }
// }


// Path: app/src/main/java/com/habitissimo/vespapp/database/Database.java
import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import com.google.gson.Gson;
import com.habitissimo.vespapp.Vespapp;

package com.habitissimo.vespapp.database;



public class Database {
    private SharedPreferences preferences;
    private Gson gson;

    public Database(Context context, Gson gson) {
        this.gson = gson;
        preferences = context.getSharedPreferences("database", Context.MODE_PRIVATE);
    }

    public static Database get(Context context) {
        return Vespapp.get(context).getDatabase();