Java Code Examples for com.socks.jiandan.BuildConfig#DEBUG

The following examples show how to use com.socks.jiandan.BuildConfig#DEBUG . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StrictModeUtil.java    From JianDan with Apache License 2.0 6 votes vote down vote up
public static void init() {
    if (false && BuildConfig.DEBUG && Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) {

        //线程监控,会弹框哦
        StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .penaltyDialog()
                .build());

        //VM监控
        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .build());
    }
}
 
Example 2
Source File: RequestManager.java    From JianDan_OkHttp with Apache License 2.0 6 votes vote down vote up
public static void addRequest(Request<?> request, Object tag) {
    if (tag != null) {
        request.setTag(tag);
    }
    //给每个请求重设超时、重试次数
    request.setRetryPolicy(new DefaultRetryPolicy(
            OUT_TIME,
            TIMES_OF_RETRY,
            DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));

    mRequestQueue.add(request);

    if (BuildConfig.DEBUG) {
        Logger.d(request.getUrl());
    }

}
 
Example 3
Source File: StrictModeUtil.java    From JianDan_OkHttp with Apache License 2.0 6 votes vote down vote up
public static void init() {
    if (false && BuildConfig.DEBUG && Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) {

        //线程监控,会弹框哦
        StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .penaltyDialog()
                .build());

        //VM监控
        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .build());
    }
}
 
Example 4
Source File: StrictModeUtil.java    From JianDanRxJava with Apache License 2.0 6 votes vote down vote up
public static void init() {
    if (false && BuildConfig.DEBUG && Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) {

        //线程监控,会弹框哦
        StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .penaltyDialog()
                .build());

        //VM监控
        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .build());
    }
}
 
Example 5
Source File: RequestManager.java    From JianDan with Apache License 2.0 6 votes vote down vote up
public static void addRequest(Request<?> request, Object tag) {
    if (tag != null) {
        request.setTag(tag);
    }
    //给每个请求重设超时、重试次数
    request.setRetryPolicy(new DefaultRetryPolicy(
            OUT_TIME,
            TIMES_OF_RETRY,
            DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));

    mRequestQueue.add(request);

    if (BuildConfig.DEBUG) {
        Logger.d(request.getUrl());
    }

}
 
Example 6
Source File: JDApplication.java    From JianDan with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate() {
    StrictModeUtil.init();
    super.onCreate();
    refWatcher = LeakCanary.install(this);
    mContext = this;
    ImageLoadProxy.initImageLoader(this);

    if (BuildConfig.DEBUG) {
        Logger.init().hideThreadInfo().setMethodCount(1).setLogLevel(LogLevel.FULL);
    }

    Stetho.initialize(
            Stetho.newInitializerBuilder(this)
                    .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
                    .build());

}
 
Example 7
Source File: RequestManager.java    From JianDan_OkHttpWithVolley with Apache License 2.0 6 votes vote down vote up
public static void addRequest(Request<?> request, Object tag) {
    if (tag != null) {
        request.setTag(tag);
    }
    //给每个请求重设超时、重试次数
    request.setRetryPolicy(new DefaultRetryPolicy(
            OUT_TIME,
            TIMES_OF_RETRY,
            DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));

    mRequestQueue.add(request);

    if (BuildConfig.DEBUG) {
        Logger.d(request.getUrl());
    }

}
 
Example 8
Source File: StrictModeUtil.java    From JianDan_OkHttpWithVolley with Apache License 2.0 6 votes vote down vote up
public static void init() {
    if (false && BuildConfig.DEBUG && Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) {

        //线程监控,会弹框哦
        StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .penaltyDialog()
                .build());

        //VM监控
        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .build());
    }
}
 
Example 9
Source File: BaseActivity.java    From JianDan with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mContext = this;

    if (BuildConfig.DEBUG) {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();
    } else {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();
    }
}
 
Example 10
Source File: BaseFragment.java    From JianDan with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (BuildConfig.DEBUG) {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();
    } else {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();
    }

}
 
Example 11
Source File: ImageLoadProxy.java    From JianDan with Apache License 2.0 5 votes vote down vote up
public static void initImageLoader(Context context) {
    ImageLoaderConfiguration.Builder build = new ImageLoaderConfiguration.Builder(context);
    build.tasksProcessingOrder(QueueProcessingType.LIFO);
    build.diskCacheSize(MAX_DISK_CACHE);
    build.memoryCacheSize(MAX_MEMORY_CACHE);
    build.memoryCache(new LruMemoryCache(MAX_MEMORY_CACHE));

    if (BuildConfig.DEBUG && isShowLog) {
        build.writeDebugLogs();
    }
    getImageLoader().init(build.build());
}
 
Example 12
Source File: BaseActivity.java    From JianDan_OkHttpWithVolley with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mContext = this;

    if (BuildConfig.DEBUG) {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();
    } else {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();
    }
}
 
Example 13
Source File: ImageLoadProxy.java    From JianDanRxJava with Apache License 2.0 5 votes vote down vote up
public static void initImageLoader(Context context) {
    ImageLoaderConfiguration.Builder build = new ImageLoaderConfiguration.Builder(context);
    build.tasksProcessingOrder(QueueProcessingType.LIFO);
    build.diskCacheSize(MAX_DISK_CACHE);
    build.memoryCacheSize(MAX_MEMORY_CACHE);
    build.memoryCache(new LruMemoryCache(MAX_MEMORY_CACHE));

    if (BuildConfig.DEBUG && isShowLog) {
        build.writeDebugLogs();
    }
    getImageLoader().init(build.build());
}
 
Example 14
Source File: ImageLoadProxy.java    From JianDan_OkHttpWithVolley with Apache License 2.0 5 votes vote down vote up
public static void initImageLoader(Context context) {
    ImageLoaderConfiguration.Builder build = new ImageLoaderConfiguration.Builder(context);
    build.tasksProcessingOrder(QueueProcessingType.LIFO);
    build.diskCacheSize(MAX_DISK_CACHE);
    build.memoryCacheSize(MAX_MEMORY_CACHE);
    build.memoryCache(new LruMemoryCache(MAX_MEMORY_CACHE));

    if (BuildConfig.DEBUG && isShowLog) {
        build.writeDebugLogs();
    }
    getImageLoader().init(build.build());
}
 
Example 15
Source File: BaseActivity.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mContext = this;

    if (BuildConfig.DEBUG) {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();
    } else {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();
    }
}
 
Example 16
Source File: JDApplication.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    StrictModeUtil.init();
    super.onCreate();
    refWatcher = LeakCanary.install(this);
    mContext = this;
    ImageLoadProxy.initImageLoader(this);

    if (BuildConfig.DEBUG) {
        Logger.init().hideThreadInfo().setMethodCount(1).setLogLevel(LogLevel.FULL);
    }
}
 
Example 17
Source File: BaseFragment.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (BuildConfig.DEBUG) {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();
    } else {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();
    }

}
 
Example 18
Source File: ImageLoadProxy.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
public static void initImageLoader(Context context) {
    ImageLoaderConfiguration.Builder build = new ImageLoaderConfiguration.Builder(context);
    build.tasksProcessingOrder(QueueProcessingType.LIFO);
    build.diskCacheSize(MAX_DISK_CACHE);
    build.memoryCacheSize(MAX_MEMORY_CACHE);
    build.memoryCache(new LruMemoryCache(MAX_MEMORY_CACHE));

    if (BuildConfig.DEBUG && isShowLog) {
        build.writeDebugLogs();
    }
    getImageLoader().init(build.build());
}
 
Example 19
Source File: BaseFragment.java    From JianDan_OkHttpWithVolley with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (BuildConfig.DEBUG) {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();
    } else {
        Logger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();
    }

}
 
Example 20
Source File: JDApplication.java    From JianDan_OkHttpWithVolley with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    StrictModeUtil.init();
    super.onCreate();
    refWatcher = LeakCanary.install(this);
    mContext = this;
    ImageLoadProxy.initImageLoader(this);

    if (BuildConfig.DEBUG) {
        Logger.init().hideThreadInfo().setMethodCount(1).setLogLevel(LogLevel.FULL);
    }
}