Java Code Examples for com.socks.jiandan.BuildConfig

The following examples show how to use com.socks.jiandan.BuildConfig. These examples are extracted from open source projects. 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 Project: JianDan_OkHttpWithVolley   Source File: StrictModeUtil.java    License: 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 Project: JianDan_OkHttpWithVolley   Source File: RequestManager.java    License: 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 Project: JianDan   Source File: JDApplication.java    License: 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 4
Source Project: JianDan   Source File: StrictModeUtil.java    License: 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 Project: JianDan   Source File: RequestManager.java    License: 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 Project: JianDanRxJava   Source File: StrictModeUtil.java    License: 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 7
Source Project: JianDan_OkHttp   Source File: StrictModeUtil.java    License: 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 8
Source Project: JianDan_OkHttp   Source File: RequestManager.java    License: 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 9
Source Project: JianDan_OkHttpWithVolley   Source File: BaseActivity.java    License: 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 Project: JianDan_OkHttpWithVolley   Source File: JDApplication.java    License: 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 11
Source Project: JianDan_OkHttpWithVolley   Source File: BaseFragment.java    License: 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 12
Source Project: JianDan_OkHttpWithVolley   Source File: ImageLoadProxy.java    License: 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 13
Source Project: JianDan   Source File: BaseActivity.java    License: 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 14
Source Project: JianDan   Source File: BaseFragment.java    License: 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 15
Source Project: JianDan   Source File: ImageLoadProxy.java    License: 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 16
Source Project: JianDanRxJava   Source File: ImageLoadProxy.java    License: 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 17
Source Project: JianDan_OkHttp   Source File: BaseActivity.java    License: 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 18
Source Project: JianDan_OkHttp   Source File: JDApplication.java    License: 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 19
Source Project: JianDan_OkHttp   Source File: BaseFragment.java    License: 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 Project: JianDan_OkHttp   Source File: ImageLoadProxy.java    License: 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());
}