X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/6da5d3c212d80042e07c29e9cedbf40643039b4b..f728c502c55c85f950d142a99fac2fce49c4a9a3:/src/com/owncloud/android/MainApp.java diff --git a/src/com/owncloud/android/MainApp.java b/src/com/owncloud/android/MainApp.java index 85718ff6..072469d2 100644 --- a/src/com/owncloud/android/MainApp.java +++ b/src/com/owncloud/android/MainApp.java @@ -18,20 +18,46 @@ package com.owncloud.android; import android.app.Application; import android.content.Context; + +import com.owncloud.android.datamodel.ThumbnailsCacheManager; +import com.owncloud.android.lib.common.OwnCloudClientManagerFactory; +import com.owncloud.android.lib.common.OwnCloudClientManagerFactory.Policy; +import com.owncloud.android.lib.common.utils.Log_OC; /** * Main Application of the project * - * Contains methods to build the "static" strings. These strings were before constants in different classes + * Contains methods to build the "static" strings. These strings were before constants in different + * classes * * @author masensio + * @author David A. Velasco */ public class MainApp extends Application { - + + private static final String AUTH_ON = "on"; + private static Context mContext; - + public void onCreate(){ super.onCreate(); MainApp.mContext = getApplicationContext(); + + // keep a single session per account handling session cookie in requests (& all the other cookies) + OwnCloudClientManagerFactory.setDefaultPolicy(Policy.SINGLE_SESSION_PER_ACCOUNT); + + // initialise thumbnails cache on background thread + new ThumbnailsCacheManager.InitDiskCacheTask().execute(); + + if (BuildConfig.DEBUG) { + + String dataFolder = getDataFolder(); + + // Set folder for store logs + Log_OC.setLogDataFolder(dataFolder); + + Log_OC.startLogging(); + Log_OC.d("Debug", "start logging"); + } } public static Context getAppContext() { @@ -44,7 +70,7 @@ public class MainApp extends Application { public static String getAccountType() { return getAppContext().getResources().getString(R.string.account_type); } - + // From AccountAuthenticator // public static final String AUTHORITY = "org.owncloud"; public static String getAuthority() { @@ -78,4 +104,5 @@ public class MainApp extends Application { public static String getLogName() { return getAppContext().getResources().getString(R.string.log_name); } + }