Android开发人员不得不收集的代码(持续更新中)

本文原作者Blankj,通过维权骑士授权品牌馆授权转载。

README of English

API

  • Activity相关→ActivityUtils.javaDemo

    isActivityExists   : 判断是否存在Activity
    startActivity      : 打开Activity
    getLauncherActivity: 获取入口activity
    getTopActivity     : 获取栈顶Activity
    
  • App相关→AppUtils.javaDemo

    isInstallApp         : 判断App是否安装
    installApp           : 安装App(支持7.0)
    installAppSilent     : 静默安装App
    uninstallApp         : 卸载App
    uninstallAppSilent   : 静默卸载App
    isAppRoot            : 判断App是否有root权限
    launchApp            : 打开App
    getAppPackageName    : 获取App包名
    getAppDetailsSettings: 获取App具体设置
    getAppName           : 获取App名称
    getAppIcon           : 获取App图标
    getAppPath           : 获取App路径
    getAppVersionName    : 获取App版本号
    getAppVersionCode    : 获取App版本码
    isSystemApp          : 判断App是否是系统应用
    isAppDebug           : 判断App是否是Debug版本
    getAppSignature      : 获取App签名
    getAppSignatureSHA1  : 获取应用签名的的SHA1值
    isAppForeground      : 判断App是否处于前台
    getForegroundApp     : 获取前台应用包名
    getAppInfo           : 获取App信息
    getAppsInfo          : 获取所有已安装App信息
    cleanAppData         : 清除App所有数据
    
  • 栏相关→BarUtils.java

    setTransparentStatusBar: 设置透明状态栏(api大于19方可使用)
    hideStatusBar          : 隐藏状态栏
    getStatusBarHeight     : 获取状态栏高度
    isStatusBarExists      : 判断状态栏是否存在
    getActionBarHeight     : 获取ActionBar高度
    showNotificationBar    : 显示通知栏
    hideNotificationBar    : 隐藏通知栏
    
  • 缓存相关→CacheUtils.javaTest

    getInstance    : 获取缓存实例
    put            : 缓存中写入数据
    getBytes       : 缓存中读取字节数组
    getString      : 缓存中读取String
    getJSONObject  : 缓存中读取JSONObject
    getJSONArray   : 缓存中读取JSONArray
    getBitmap      : 缓存中读取Bitmap
    getDrawable    : 缓存中读取Drawable
    getParcelable  : 缓存中读取Parcelable
    getSerializable: 缓存中读取Serializable
    getCacheSize   : 获取缓存大小
    getCacheCount  : 获取缓存个数
    remove         : 根据键值移除缓存
    clear          : 清除所有缓存
    
  • 清除相关→CleanUtils.javaDemo

    cleanInternalCache   : 清除内部缓存
    cleanInternalFiles   : 清除内部文件
    cleanInternalDbs     : 清除内部数据库
    cleanInternalDbByName: 根据名称清除数据库
    cleanInternalSP      : 清除内部SP
    cleanExternalCache   : 清除外部缓存
    cleanCustomCache     : 清除自定义目录下的文件
    
  • 剪贴板相关→ClipboardUtils.java

    copyText  : 复制文本到剪贴板
    getText   : 获取剪贴板的文本
    copyUri   : 复制uri到剪贴板
    getUri    : 获取剪贴板的uri
    copyIntent: 复制意图到剪贴板
    getIntent : 获取剪贴板的意图
    
  • 关闭相关→CloseUtils.java

    closeIO       : 关闭IO
    closeIOQuietly: 安静关闭IO
    
  • 转换相关→ConvertUtils.javaTest

    bytes2HexString, hexString2Bytes        : byteArr与hexString互转
    chars2Bytes, bytes2Chars                : charArr与byteArr互转
    memorySize2Byte, byte2MemorySize        : 以unit为单位的内存大小与字节数互转
    byte2FitMemorySize                      : 字节数转合适内存大小
    timeSpan2Millis, millis2TimeSpan        : 以unit为单位的时间长度与毫秒时间戳互转
    millis2FitTimeSpan                      : 毫秒时间戳转合适时间长度
    bytes2Bits, bits2Bytes                  : bytes与bits互转
    input2OutputStream, output2InputStream  : inputStream与outputStream互转
    inputStream2Bytes, bytes2InputStream    : inputStream与byteArr互转
    outputStream2Bytes, bytes2OutputStream  : outputStream与byteArr互转
    inputStream2String, string2InputStream  : inputStream与string按编码互转
    outputStream2String, string2OutputStream: outputStream与string按编码互转
    bitmap2Bytes, bytes2Bitmap              : bitmap与byteArr互转
    drawable2Bitmap, bitmap2Drawable        : drawable与bitmap互转
    drawable2Bytes, bytes2Drawable          : drawable与byteArr互转
    view2Bitmap                             : view转Bitmap
    dp2px, px2dp                            : dp与px互转
    sp2px, px2sp                            : sp与px互转
    
  • 崩溃相关→CrashUtils.java

    getInstance: 获取单例
    init       : 初始化
    
  • 设备相关→DeviceUtils.javaDemo

    isDeviceRooted   : 判断设备是否rooted
    getSDKVersion    : 获取设备系统版本号
    getAndroidID     : 获取设备AndroidID
    getMacAddress    : 获取设备MAC地址
    getManufacturer  : 获取设备厂商
    getModel         : 获取设备型号
    shutdown         : 关机
    reboot           : 重启
    reboot2Recovery  : 重启到recovery
    reboot2Bootloader: 重启到bootloader
    
  • 判空相关→EmptyUtils.javaTest

    isEmpty   : 判断对象是否为空
    isNotEmpty: 判断对象是否非空
    
  • 编码解码相关→EncodeUtils.javaTest

    urlEncode          : URL编码
    urlDecode          : URL解码
    base64Encode       : Base64编码
    base64Encode2String: Base64编码
    base64Decode       : Base64解码
    base64UrlSafeEncode: Base64URL安全编码
    htmlEncode         : Html编码
    htmlDecode         : Html解码
    
  • 加密解密相关→EncryptUtils.javaTest

    encryptMD2, encryptMD2ToString                        : MD2加密
    encryptMD5, encryptMD5ToString                        : MD5加密
    encryptMD5File, encryptMD5File2String                 : MD5加密文件
    encryptSHA1, encryptSHA1ToString                      : SHA1加密
    encryptSHA224, encryptSHA224ToString                  : SHA224加密
    encryptSHA256, encryptSHA256ToString                  : SHA256加密
    encryptSHA384, encryptSHA384ToString                  : SHA384加密
    encryptSHA512, encryptSHA512ToString                  : SHA512加密
    encryptHmacMD5, encryptHmacMD5ToString                : HmacMD5加密
    encryptHmacSHA1, encryptHmacSHA1ToString              : HmacSHA1加密
    encryptHmacSHA224, encryptHmacSHA224ToString          : HmacSHA224加密
    encryptHmacSHA256, encryptHmacSHA256ToString          : HmacSHA256加密
    encryptHmacSHA384, encryptHmacSHA384ToString          : HmacSHA384加密
    encryptHmacSHA512, encryptHmacSHA512ToString          : HmacSHA512加密
    encryptDES, encryptDES2HexString, encryptDES2Base64   : DES加密
    decryptDES, decryptHexStringDES, decryptBase64DES     : DES解密
    encrypt3DES, encrypt3DES2HexString, encrypt3DES2Base64: 3DES加密
    decrypt3DES, decryptHexString3DES, decryptBase64_3DES : 3DES解密
    encryptAES, encryptAES2HexString, encryptAES2Base64   : AES加密
    decryptAES, decryptHexStringAES, decryptBase64AES     : AES解密
    
  • 文件相关→FileIOUtils.javaTest

    writeFileFromIS            : 将输入流写入文件
    writeFileFromBytesByStream : 将字节数组写入文件
    writeFileFromBytesByChannel: 将字节数组写入文件
    writeFileFromBytesByMap    : 将字节数组写入文件
    writeFileFromString        : 将字符串写入文件
    readFile2List              : 读取文件到字符串链表中
    readFile2String            : 读取文件到字符串中
    readFile2BytesByStream     : 读取文件到字节数组中
    readFile2BytesByChannel    : 读取文件到字节数组中
    readFile2BytesByMap        : 读取文件到字节数组中
    
  • 文件相关→FileUtils.javaTest

    getFileByPath            : 根据文件路径获取文件
    isFileExists             : 判断文件是否存在
    rename                   : 重命名文件
    isDir                    : 判断是否是目录
    isFile                   : 判断是否是文件
    createOrExistsDir        : 判断目录是否存在,不存在则判断是否创建成功
    createOrExistsFile       : 判断文件是否存在,不存在则判断是否创建成功
    createFileByDeleteOldFile: 判断文件是否存在,存在则在创建之前删除
    copyDir                  : 复制目录
    copyFile                 : 复制文件
    moveDir                  : 移动目录
    moveFile                 : 移动文件
    deleteDir                : 删除目录
    deleteFile               : 删除文件
    listFilesInDir           : 获取目录下所有文件
    listFilesInDir           : 获取目录下所有文件包括子目录
    listFilesInDirWithFilter : 获取目录下所有后缀名为suffix的文件
    listFilesInDirWithFilter : 获取目录下所有后缀名为suffix的文件包括子目录
    listFilesInDirWithFilter : 获取目录下所有符合filter的文件
    listFilesInDirWithFilter : 获取目录下所有符合filter的文件包括子目录
    searchFileInDir          : 获取目录下指定文件名的文件包括子目录
    getFileLastModified      : 获取文件最后修改的毫秒时间戳
    getFileCharsetSimple     : 简单获取文件编码格式
    getFileLines             : 获取文件行数
    getDirSize               : 获取目录大小
    getFileSize              : 获取文件大小
    getDirLength             : 获取目录长度
    getFileLength            : 获取文件长度
    getFileMD5               : 获取文件的MD5校验码
    getFileMD5ToString       : 获取文件的MD5校验码
    getDirName               : 根据全路径获取最长目录
    getFileName              : 根据全路径获取文件名
    getFileNameNoExtension   : 根据全路径获取文件名不带拓展名
    getFileExtension         : 根据全路径获取文件拓展名
    
  • Fragment相关→FragmentUtils.javaDemo

    addFragment              : 新增fragment
    hideAddFragment          : 先隐藏后新增fragment
    addFragments             : 新增多个fragment
    removeFragment           : 移除fragment
    removeToFragment         : 移除到指定fragment
    removeFragments          : 移除同级别fragment
    removeAllFragments       : 移除所有fragment
    replaceFragment          : 替换fragment
    popFragment              : 出栈fragment
    popToFragment            : 出栈到指定fragment
    popFragments             : 出栈同级别fragment
    popAllFragments          : 出栈所有fragment
    popAddFragment           : 先出栈后新增fragment
    hideFragment             : 隐藏fragment
    hideFragments            : 隐藏同级别fragment
    showFragment             : 显示fragment
    hideShowFragment         : 先隐藏后显示fragment
    getLastAddFragment       : 获取同级别最后加入的fragment
    getLastAddFragmentInStack: 获取栈中同级别最后加入的fragment
    getTopShowFragment       : 获取顶层可见fragment
    getTopShowFragmentInStack: 获取栈中顶层可见fragment
    getFragments             : 获取同级别fragment
    getFragmentsInStack      : 获取栈中同级别fragment
    getAllFragments          : 获取所有fragment
    getAllFragmentsInStack   : 获取栈中所有fragment
    getPreFragment           : 获取目标fragment的前一个fragment
    findFragment             : 查找fragment
    dispatchBackPress        : 处理fragment回退键
    setBackgroundColor       : 设置背景色
    setBackgroundResource    : 设置背景资源
    setBackground            : 设置背景
    
  • Handler相关→HandlerUtils.javaDemo

    HandlerHolder: 使用必读
    
  • 图片相关→ImageUtils.javaDemo

    bitmap2Bytes, bytes2Bitmap      : bitmap与byteArr互转
    drawable2Bitmap, bitmap2Drawable: drawable与bitmap互转
    drawable2Bytes, bytes2Drawable  : drawable与byteArr互转
    getBitmap                       : 获取bitmap
    scale                           : 缩放图片
    clip                            : 裁剪图片
    skew                            : 倾斜图片
    rotate                          : 旋转图片
    getRotateDegree                 : 获取图片旋转角度
    toRound                         : 转为圆形图片
    toRoundCorner                   : 转为圆角图片
    fastBlur                        : 快速模糊
    renderScriptBlur                : renderScript模糊图片
    stackBlur                       : stack模糊图片
    addFrame                        : 添加颜色边框
    addReflection                   : 添加倒影
    addTextWatermark                : 添加文字水印
    addImageWatermark               : 添加图片水印
    toAlpha                         : 转为alpha位图
    toGray                          : 转为灰度图片
    save                            : 保存图片
    isImage                         : 根据文件名判断文件是否为图片
    getImageType                    : 获取图片类型
    compressByScale                 : 按缩放压缩
    compressByQuality               : 按质量压缩
    compressBySampleSize            : 按采样大小压缩
    
  • 意图相关→IntentUtils.java

    getInstallAppIntent        : 获取安装App(支持6.0)的意图
    getUninstallAppIntent      : 获取卸载App的意图
    getLaunchAppIntent         : 获取打开App的意图
    getAppDetailsSettingsIntent: 获取App具体设置的意图
    getShareTextIntent         : 获取分享文本的意图
    getShareImageIntent        : 获取分享图片的意图
    getComponentIntent         : 获取其他应用组件的意图
    getShutdownIntent          : 获取关机的意图
    getCaptureIntent           : 获取拍照的意图
    
  • 键盘相关→KeyboardUtils.javaDemo

    hideSoftInput               : 动态隐藏软键盘
    clickBlankArea2HideSoftInput: 点击屏幕空白区域隐藏软键盘
    showSoftInput               : 动态显示软键盘
    toggleSoftInput             : 切换键盘显示与否状态
    
  • 定位相关→LocationUtils.javaDemo

    isGpsEnabled     : 判断Gps是否可用
    isLocationEnabled: 判断定位是否可用
    openGpsSettings  : 打开Gps设置界面
    register         : 注册
    unregister       : 注销
    getAddress       : 根据经纬度获取地理位置
    getCountryName   : 根据经纬度获取所在国家
    getLocality      : 根据经纬度获取所在地
    getStreet        : 根据经纬度获取所在街道
    isBetterLocation : 是否更好的位置
    isSameProvider   : 是否相同的提供者
    
  • 日志相关→LogUtils.javaDemo

    Builder.setLogSwitch     : 设置log总开关
    Builder.setConsoleSwitch : 设置log控制台开关
    Builder.setGlobalTag     : 设置log全局tag
    Builder.setLogHeadSwitch : 设置log头部信息开关
    Builder.setLog2FileSwitch: 设置log文件开关
    Builder.setDir           : 设置log文件存储目录
    Builder.setBorderSwitch  : 设置log边框开关
    Builder.setConsoleFilter : 设置log控制台过滤器
    Builder.setFileFilter    : 设置log文件过滤器
    v                        : Verbose日志
    d                        : Debug日志
    i                        : Info日志
    w                        : Warn日志
    e                        : Error日志
    a                        : Assert日志
    file                     : log到文件
    json                     : log字符串之json
    xml                      : log字符串之xml
    
  • 网络相关→NetworkUtils.javaDemo

    openWirelessSettings  : 打开网络设置界面
    isConnected           : 判断网络是否连接
    isAvailableByPing     : 判断网络是否可用
    getDataEnabled        : 判断移动数据是否打开
    setDataEnabled        : 打开或关闭移动数据
    is4G                  : 判断网络是否是4G
    getWifiEnabled        : 判断wifi是否打开
    setWifiEnabled        : 打开或关闭wifi
    isWifiConnected       : 判断wifi是否连接状态
    isWifiAvailable       : 判断wifi数据是否可用
    getNetworkOperatorName: 获取移动网络运营商名称
    getNetworkType        : 获取当前网络类型
    getIPAddress          : 获取IP地址
    getDomainAddress      : 获取域名ip地址
    
  • 手机相关→PhoneUtils.javaDemo

    isPhone            : 判断设备是否是手机
    getIMEI            : 获取IMEI码
    getIMSI            : 获取IMSI码
    getPhoneType       : 获取移动终端类型
    isSimCardReady     : 判断sim卡是否准备好
    getSimOperatorName : 获取Sim卡运营商名称
    getSimOperatorByMnc: 获取Sim卡运营商名称
    getPhoneStatus     : 获取手机状态信息
    dial               : 跳至拨号界面
    call               : 拨打phoneNumber
    sendSms            : 跳至发送短信界面
    sendSmsSilent      : 发送短信
    getAllContactInfo  : 获取手机联系人
    getContactNum      : 打开手机联系人界面点击联系人后便获取该号码
    getAllSMS          : 获取手机短信并保存到xml中
    
  • 拼音相关→PinyinUtils.javaTest

    ccs2Pinyin           : 汉字转拼音
    ccs2Pinyin           : 汉字转拼音
    getPinyinFirstLetter : 获取第一个汉字首字母
    getPinyinFirstLetters: 获取所有汉字的首字母
    getSurnamePinyin     : 根据名字获取姓氏的拼音
    getSurnameFirstLetter: 根据名字获取姓氏的首字母
    
  • 进程相关→ProcessUtils.javaDemo

    getForegroundProcessName  : 获取前台线程包名
    killAllBackgroundProcesses: 杀死所有的后台服务进程
    killBackgroundProcesses   : 杀死后台服务进程
    
  • 正则相关→RegexUtils.javaTest

    isMobileSimple : 验证手机号(简单)
    isMobileExact  : 验证手机号(精确)
    isTel          : 验证电话号码
    isIDCard15     : 验证身份证号码15位
    isIDCard18     : 验证身份证号码18位
    isEmail        : 验证邮箱
    isURL          : 验证URL
    isZh           : 验证汉字
    isUsername     : 验证用户名
    isDate         : 验证yyyy-MM-dd格式的日期校验,已考虑平闰年
    isIP           : 验证IP地址
    isMatch        : 判断是否匹配正则
    getMatches     : 获取正则匹配的部分
    getSplits      : 获取正则匹配分组
    getReplaceFirst: 替换正则匹配的第一部分
    getReplaceAll  : 替换所有正则匹配的部分
    
  • 屏幕相关→ScreenUtils.java

    getScreenWidth         : 获取屏幕的宽度(单位:px)
    getScreenHeight        : 获取屏幕的高度(单位:px)
    setLandscape           : 设置屏幕为横屏
    setPortrait            : 设置屏幕为竖屏
    isLandscape            : 判断是否横屏
    isPortrait             : 判断是否竖屏
    getScreenRotation      : 获取屏幕旋转角度
    captureWithStatusBar   : 获取当前屏幕截图,包含状态栏
    captureWithoutStatusBar: 获取当前屏幕截图,不包含状态栏
    isScreenLock           : 判断是否锁屏
    
  • SD卡相关→SDCardUtils.javaDemo

    isSDCardEnable: 判断SD卡是否可用
    getSDCardPath : 获取SD卡路径
    getDataPath   : 获取SD卡Data路径
    getFreeSpace  : 计算SD卡的剩余空间
    getSDCardInfo : 获取SD卡信息
    
  • 服务相关→ServiceUtils.java

    getAllRunningService: 获取所有运行的服务
    startService        : 启动服务
    stopService         : 停止服务
    bindService         : 绑定服务
    unbindService       : 解绑服务
    isServiceRunning    : 判断服务是否运行
    
  • Shell相关→ShellUtils.java

    execCmd: 是否是在root下执行命令
    
  • 尺寸相关→SizeUtils.java

    dp2px, px2dp     : dp与px转换
    sp2px, px2sp     : sp与px转换
    applyDimension   : 各种单位转换
    forceGetViewSize : 在onCreate中获取视图的尺寸
    measureView      : 测量视图尺寸
    getMeasuredWidth : 获取测量视图宽度
    getMeasuredHeight: 获取测量视图高度
    
  • Snackbar相关→SnackbarUtils.javaDemo

    showShort     : 显示短时snackbar
    showLong      : 显示长时snackbar
    showIndefinite: 显示自定义时长snackbar
    addView       : 为SnackBar添加布局
    dismiss       : 取消snackbar显示
    
  • SpannableString相关→SpannableStringUtils.javaDemo

    Builder.setFlag           : 设置标识
    Builder.setForegroundColor: 设置前景色
    Builder.setBackgroundColor: 设置背景色
    Builder.setQuoteColor     : 设置引用线的颜色
    Builder.setLeadingMargin  : 设置缩进
    Builder.setMargin         : 设置间距
    Builder.setBullet         : 设置列表标记
    Builder.setFontSize       : 设置字体尺寸
    Builder.setFontProportion : 设置字体比例
    Builder.setFontXProportion: 设置字体横向比例
    Builder.setStrikethrough  : 设置删除线
    Builder.setUnderline      : 设置下划线
    Builder.setSuperscript    : 设置上标
    Builder.setSubscript      : 设置下标
    Builder.setBold           : 设置粗体
    Builder.setItalic         : 设置斜体
    Builder.setBoldItalic     : 设置粗斜体
    Builder.setFontFamily     : 设置字体系列
    Builder.setTypeface       : 设置字体
    Builder.setAlign          : 设置对齐
    Builder.setBitmap         : 设置图片
    Builder.setDrawable       : 设置图片
    Builder.setUri            : 设置图片
    Builder.setResourceId     : 设置图片
    Builder.setClickSpan      : 设置点击事件
    Builder.setUrl            : 设置超链接
    Builder.setBlur           : 设置模糊
    Builder.append            : 追加样式字符串
    Builder.create            : 创建样式字符串
    
  • SP相关→SPUtils.javaTest

    getInstance: 获取SP实例
    put        : SP中写入数据
    getString  : SP中读取String
    getInt     : SP中读取int
    getLong    : SP中读取long
    getFloat   : SP中读取float
    getBoolean : SP中读取boolean
    getAll     : SP中获取所有键值对
    contains   : SP中是否存在该key
    remove     : SP中移除该key
    clear      : SP中清除所有数据
    
  • 字符串相关→StringUtils.javaTest

    isEmpty         : 判断字符串是否为null或长度为0
    isTrimEmpty     : 判断字符串是否为null或全为空格
    isSpace         : 判断字符串是否为null或全为空白字符
    equals          : 判断两字符串是否相等
    equalsIgnoreCase: 判断两字符串忽略大小写是否相等
    null2Length0    : null转为长度为0的字符串
    length          : 返回字符串长度
    upperFirstLetter: 首字母大写
    lowerFirstLetter: 首字母小写
    reverse         : 反转字符串
    toDBC           : 转化为半角字符
    toSBC           : 转化为全角字符
    
  • 线程池相关→ThreadPoolUtils.java

    ThreadPoolUtils       : ThreadPoolUtils构造函数
    execute               : 在未来某个时间执行给定的命令
    execute               : 在未来某个时间执行给定的命令链表
    shutDown              : 待以前提交的任务执行完毕后关闭线程池
    shutDownNow           : 试图停止所有正在执行的活动任务
    isShutDown            : 判断线程池是否已关闭
    isTerminated          : 关闭线程池后判断所有任务是否都已完成
    awaitTermination      : 请求关闭、发生超时或者当前线程中断
    submit                : 提交一个Callable任务用于执行
    submit                : 提交一个Runnable任务用于执行
    invokeAll, invokeAny  : 执行给定的任务
    schedule              : 延迟执行Runnable命令
    schedule              : 延迟执行Callable命令
    scheduleWithFixedRate : 延迟并循环执行命令
    scheduleWithFixedDelay: 延迟并以固定休息时间循环执行命令
    
  • 时间相关→TimeUtils.javaTest

    millis2String           : 将时间戳转为时间字符串
    string2Millis           : 将时间字符串转为时间戳
    string2Date             : 将时间字符串转为Date类型
    date2String             : 将Date类型转为时间字符串
    date2Millis             : 将Date类型转为时间戳
    millis2Date             : 将时间戳转为Date类型
    getTimeSpan             : 获取两个时间差(单位:unit)
    getFitTimeSpan          : 获取合适型两个时间差
    getNowMills             : 获取当前毫秒时间戳
    getNowString            : 获取当前时间字符串
    getNowDate              : 获取当前Date
    getTimeSpanByNow        : 获取与当前时间的差(单位:unit)
    getFitTimeSpanByNow     : 获取合适型与当前时间的差
    getFriendlyTimeSpanByNow: 获取友好型与当前时间的差
    getMillis               : 获取与给定时间等于时间差的时间戳
    getString               : 获取与给定时间等于时间差的时间字符串
    getDate                 : 获取与给定时间等于时间差的Date
    getMillisByNow          : 获取与当前时间等于时间差的时间戳
    getStringByNow          : 获取与当前时间等于时间差的时间字符串
    getDateByNow            : 获取与当前时间等于时间差的Date
    isToday                 : 判断是否今天
    isLeapYear              : 判断是否闰年
    getChineseWeek          : 获取中式星期
    getUSWeek               : 获取美式式星期
    getWeekIndex            : 获取星期索引
    getWeekOfMonth          : 获取月份中的第几周
    getWeekOfYear           : 获取年份中的第几周
    getChineseZodiac        : 获取生肖
    getZodiac               : 获取星座
    
  • 吐司相关→ToastUtils.javaDemo

    setGravity   : 设置吐司位置
    setView      : 设置吐司view
    getView      : 获取吐司view
    showShortSafe: 安全地显示短时吐司
    showLongSafe : 安全地显示长时吐司
    showShort    : 显示短时吐司
    showLong     : 显示长时吐司
    cancel       : 取消吐司显示
    
  • 压缩相关→ZipUtils.javaTest

    zipFiles          : 批量压缩文件
    zipFile           : 压缩文件
    unzipFiles        : 批量解压文件
    unzipFile         : 解压文件
    unzipFileByKeyword: 解压带有关键字的文件
    getFilesPath      : 获取压缩文件中的文件路径链表
    getComments       : 获取压缩文件中的注释链表
    getEntries        : 获取压缩文件中的文件对象
    
  • 更新Log→update_log.md


Download

Gradle:

compile 'com.blankj:utilcode:1.6.3'

How to use

// init it in the function of onCreate in ur Application
Utils.init(context);

Proguard

-keep class com.blankj.utilcode.** { *; }
-keepclassmembers class com.blankj.utilcode.** { *; }
-dontwarn com.blankj.utilcode.**

本文作者:Rance935本文出处:Android开发人员不得不收集的代码(持续更新中)转载请在开头注明作者详细信息和本文出处
欢迎关注我的微信公众号和QQ群,分享Android 开发和互联网内容
Android技术分享:群号534813930
微信号:androidparks
公众号:AndroidParks

评论

  • CheplanovaGergo回复

    viagra petit prix

    [url=http://viagralms.com/]canadian viagra[/url]

    <a href="http://viagralms.com/">canadian viagra</a>

    viagra til m?nd

  • CheplanovaGergo回复

    viagra prix redui

    [url=http://viagralms.com/]buy generic viagra[/url]

    <a href="http://viagralms.com/">cheap viagra</a>

    ayurvedic viagra for men india

  • wordpress web hosting回复

    very few websites that come about to become detailed below, from our point of view are undoubtedly well worth checking out

  • adidas ultra boost回复

    Thanks a lot for giving everyone an exceptionally special possiblity to discover important secrets from here. It's always so ideal and packed with a great time for me personally and my office mates to visit the blog not less than thrice every week to find out the fresh stuff you have got. And definitely, I'm also certainly contented with the remarkable knowledge you give. Certain 1 points in this post are ultimately the simplest I've had.

  • Egli Diana Pinto回复

    Good day I am so thrilled I found your blog, I really found you by error, while I was researching on Yahoo for something else, Nonetheless I am here now and would just like to say many thanks for a marvelous post and a all round thrilling blog (I also love the theme/design), I don’t have time to look over it all at the moment but I have book-marked it and also added your RSS feeds, so when I have time I will be back to read more, Please do keep up the superb jo.|

  • Umanizzare回复

    Hi this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I'm starting a blog soon but have no coding expertise so I wanted to get guidance from someone with experience. Any help would be enormously appreciated!|

  • Adidas Originals NMD XR1 Runner Primeknit Running Shoes White回复

    Thank you a lot for providing individuals with an extraordinarily wonderful chance to read from here. It's always very cool and also stuffed with amusement for me and my office fellow workers to visit your web site particularly thrice a week to read the latest secrets you have got. And indeed, I am just certainly impressed with the cool thoughts served by you. Selected 2 areas in this post are completely the best we have all had.

  • kobe shoes回复

    This website online is really a stroll-by for all of the data you wished about this and didn抰 know who to ask. Glimpse here, and you抣l definitely uncover it.

  • mober回复

    When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get four emails with the same comment.

    Is there any way you can remove people from that service?
    Thanks a lot!

  • CheplanovaGergo回复

    generic viagra mg price

    [url=http://viagralms.com/]buy generic viagra[/url]

    <a href="http://viagralms.com/">buy viagra online</a>

    le viagra rembourse

  • CheplanovaGergo回复

    viagra prices china

    [url=http://viagralms.com/]viagra online[/url]

    <a href="http://viagralms.com/">buy generic viagra</a>

    average cost 100 mg viagra

  • MakritskayaGergo回复

    viagra plus 100 mg

    [url=http://viagraoail.com/]online viagra[/url]

    <a href="http://viagraoail.com/">buy viagra online</a>

    viagra plus 100 mg

  • Math回复

    You actually make it seem so easy with your presentation but I find this matter to be actually something which I think I would never understand. It seems too complex and very broad for me. I'm looking forward for your next post, I will try to get the hang of it!

  • culinary回复

    Hello there, just became aware of your blog through Google, and found that it's really informative. I am gonna watch out for brussels. I will appreciate if you continue this in future. Numerous people will be benefited from your writing. Cheers!

  • Civil Law回复

    Needed to send you a very small word in order to give thanks once again just for the amazing pointers you've discussed in this case. This has been surprisingly open-handed of people like you to give unhampered what exactly most people could have supplied for an electronic book to end up making some money for themselves, specifically since you could possibly have tried it if you desired. These strategies likewise acted to provide a easy way to be sure that most people have a similar interest really like my very own to learn great deal more pertaining to this issue. I know there are lots of more pleasant opportunities in the future for people who look into your blog post.

  • dinner place回复

    I am so happy to read this. This is the type of manual that needs to be given and not the random misinformation that is at the other blogs. Appreciate your sharing this greatest doc.

  • Law School回复

    I precisely wished to say thanks once more. I am not sure the things I would've tried in the absence of those tips discussed by you directly on such a subject. It became a real fearsome difficulty for me, nevertheless witnessing a new skilled style you processed that forced me to weep with gladness. I will be happy for your advice as well as hope that you realize what an amazing job you happen to be providing training other individuals using a web site. Most likely you haven't got to know any of us.

  • Education Games回复

    I think this is one of the most vital info for me. And i'm glad reading your article. But wanna remark on some general things, The website style is wonderful, the articles is really nice : D. Good job, cheers

  • Umanizzare回复

    I was curious if you ever thought of changing the layout of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or 2 images. Maybe you could space it out better?|

  • VladilenGergo回复

    buy viagra for premature

    [url=http://viagraomz.com/]cheap viagra[/url]

    <a href="http://viagraomz.com/">buy viagra online</a>

    lo que mejor viagra

  • adidas yeezy回复

    I simply wished to thank you very much once more. I am not sure the things that I would have followed without those aspects contributed by you on such area of interest. Certainly was an absolute frightening circumstance for me personally, nevertheless taking a look at this well-written fashion you dealt with it forced me to cry with happiness. I'm happier for your assistance and as well , believe you recognize what an amazing job you're putting in training the mediocre ones thru your websites. Most likely you've never got to know any of us.

  • VladilenGergo回复

    viagra prescription no canada

    [url=http://viagraomz.com/]cheap viagra online[/url]

    <a href="http://viagraomz.com/">online viagra</a>

    try it viagra overnigh

  • AdamGergo回复

    how to get generic cialis

    [url=http://canadianiucialis.com/]cialis[/url]

    <a href="http://canadianiucialis.com/">cialis</a>

    we use it cialis for cheap

  • Itamar Serpa Fernandes回复

    Whoa! This blog looks exactly like my old one! It's on a totally different topic but it has pretty much the same layout and design. Great choice of colors!|

  • Lélio Vieira Carneiro Junio回复

    I loved as much as you will receive carried out right here. The sketch is tasteful, your authored subject matter stylish. nonetheless, you command get got an shakiness over that you wish be delivering the following. unwell unquestionably come more formerly again as exactly the same nearly very often inside case you shield this hike.|

  • AdamGergo回复

    to buy super best cialis how

    [url=http://canadianiucialis.com/]buy cialis[/url]

    <a href="http://canadianiucialis.com/">cialis cheap</a>

    freie cialis-pillen

  • yeezy boost 350回复

    I simply had to say thanks again. I'm not certain what I might have followed in the absence of the entire tips shared by you on that theme. Previously it was a real difficult dilemma in my position, however , finding out a expert strategy you dealt with that forced me to cry over contentment. I am happy for your information and then sincerely hope you really know what an amazing job you are accomplishing instructing other individuals thru your websites. Most probably you haven't got to know any of us.

  • LenaGergo回复

    viagra online australia net

    [url=http://norxcheapviagraf.com/]cheap viagra online[/url]

    <a href="http://norxcheapviagraf.com/">buy viagra online</a>

    the cost of viagra

  • thirty two cameras回复

    Whats up very cool site!! Guy .. Beautiful .. Superb ..
    I will bookmark your website and take the feeds additionally?
    I am happy to find numerous useful information here in the submit,
    we'd like work out more techniques on this regard, thanks for sharing.
    . . . . .

  • chrome hearts online回复

    you've got an important blog right here! would you prefer to make some invite posts on my blog?

  • Grupo Coral fraude回复

    I was curious if you ever thought of changing the layout of your website? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two pictures. Maybe you could space it out better?|

  • TV Stands, Mounts & Furniture回复

    This is really interesting, You're a very skilled blogger. I've joined your rss feed and look forward to seeking more of your wonderful post. Also, I've shared your web site in my social networks!

  • Exclusive Style回复

    Nice read, I just passed this onto a colleague who was doing a little research on that. And he just bought me lunch because I found it for him smile Therefore let me rephrase that: Thank you for lunch!

  • Smart Home design回复

    magnificent publish, very informative. I ponder why the other specialists of this sector do not understand this. You must continue your writing. I am sure, you have a great readers' base already!

  • Hair Removal skin care回复

    whoah this weblog is wonderful i love studying your articles. Keep up the good paintings! You understand, lots of people are hunting around for this info, you can aid them greatly.

  • Housekeeping home design回复

    It¡¦s actually a nice and helpful piece of information. I am satisfied that you simply shared this useful info with us. Please keep us informed like this. Thank you for sharing.

  • Fragrance skin care回复

    hello!,I like your writing so much! proportion we communicate extra approximately your post on AOL? I need a specialist on this area to resolve my problem. May be that's you! Taking a look ahead to peer you.

  • best dresses回复

    I really wanted to write down a small note so as to say thanks to you for all of the superb ideas you are placing on this site. My long internet investigation has at the end been rewarded with pleasant details to share with my neighbours. I would say that many of us visitors actually are unquestionably endowed to dwell in a really good place with so many perfect people with interesting suggestions. I feel really fortunate to have used your entire webpages and look forward to many more brilliant moments reading here. Thank you again for all the details.

  • Baby Cloth回复

    Useful information. Fortunate me I discovered your website unintentionally, and I'm surprised why this coincidence didn't came about in advance! I bookmarked it.

  • Vehicle Licensing回复

    Awsome website! I am loving it!! Will come back again. I am taking your feeds also