
Android工具类
一枚-狗子
这个作者很懒,什么都没留下…
展开
-
Android工具类之Gson封装类
让JSON操作变得简单的 Gson 封装类 import java.util.List;import java.util.Map;import com.google.gson.Gson;import com.google.gson.reflect.TypeToken;public class GsonUtil { private static Gson gson = null;转载 2015-09-21 10:46:22 · 10398 阅读 · 7 评论 -
Android工具类之Toast统一管理类
/** * Toast统一管理类 */public class ToastUtil { public static boolean isShow = true; /*cannot be instantiated*/ private ToastUtil() { throw new UnsupportedOperationException("cannot be原创 2016-07-15 16:04:00 · 1882 阅读 · 0 评论 -
Android工具类之字符串工具类,提供一些字符串相关的便捷方法
/** * 字符串工具类,提供一些字符串相关的便捷方法 */public class StringUtil { private StringUtil() { throw new AssertionError(); } /** * is null or its length is 0 or it is made by space * <p/原创 2016-07-15 16:03:18 · 3578 阅读 · 0 评论 -
Android工具类之SharedPreferences统一管理类
/** * SharedPreferences统一管理类 */public class SPUtil { /** * 保存在手机里面的文件名(自定义) */ public static final String FILE_NAME = "share_data"; /** * 保存数据的方法,我们需要拿到保存数据的具体类型,然后根据类型调用不同原创 2016-07-15 16:01:56 · 1376 阅读 · 0 评论 -
Android工具类之创建删除快捷图标
/** * 创建删除快捷图标 * <p/> * 需要权限: com.android.launcher.permission.INSTALL_SHORTCUT * com.android.launcher.permission.UNINSTALL_SHORTCUT */public final class ShortCutUtil { /** * Don't let any原创 2016-07-15 15:59:02 · 770 阅读 · 0 评论 -
Android工具类之SD卡辅助类
/** * SD卡辅助类 */public class SDCardUtil { private SDCardUtil() { /* cannot be instantiated */ throw new UnsupportedOperationException("cannot be instantiated"); } /** *原创 2016-07-15 15:58:15 · 685 阅读 · 0 评论 -
Android工具类之屏幕相关辅助类
/** * 屏幕相关辅助类 */public class ScreenUtil { private ScreenUtil() { /*cannot be instantiated*/ throw new UnsupportedOperationException("cannot be instantiated"); } /** *原创 2016-07-15 15:57:34 · 449 阅读 · 0 评论 -
Android工具类之手机组件调用工具类
/** * 手机组件调用工具类 */public final class PhoneUtil { private static long lastClickTime; /** * Don't let anyone instantiate this class. */ private PhoneUtil() { throw new Err原创 2016-07-15 15:56:41 · 586 阅读 · 0 评论 -
Android工具类之网络相关辅助类
/** * 网络相关辅助类 */public class NetUtil { private NetUtil() { /* cannot be instantiated */ throw new UnsupportedOperationException("cannot be instantiated"); } /** * 判断网络原创 2016-07-15 15:55:32 · 531 阅读 · 0 评论 -
Android工具类之双击退出
/** * 双击退出 */public class ExitActivityUtil extends Activity { private long exitTime = 0; //重写 onKeyDown方法 @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (原创 2016-07-15 15:53:20 · 542 阅读 · 0 评论 -
Android工具类之单位转换类
/** * 单位转换类 */public class DensityUtil { /** * cannot be instantiated */ private DensityUtil() { throw new UnsupportedOperationException("cannot be instantiated"); }原创 2016-07-15 15:52:40 · 555 阅读 · 0 评论 -
Android工具类之日期操作工具类
/** * 日期操作工具类. */public class DateUtil { /** * 英文简写如:2016 */ public static String FORMAT_Y = "yyyy"; /** * 英文简写如:12:01 */ public static String FORMAT_HM = "HH:mm";原创 2016-07-15 15:51:57 · 1826 阅读 · 0 评论 -
Android工具类之颜色工具类 包括常用的色值
/** * 颜色工具类 包括常用的色值 */public final class ColorsUtil { /** * Don't let anyone instantiate this class. */ private ColorsUtil() { throw new Error("Do not need instantiate!");原创 2016-07-15 15:50:00 · 1480 阅读 · 0 评论 -
Android工具类之App相关辅助类
/** * app相关辅助类 */public class AppUtil { private AppUtil() { /* cannot be instantiated*/ throw new UnsupportedOperationException("cannot be instantiated"); } /** * 获取原创 2016-07-15 15:48:43 · 699 阅读 · 0 评论 -
Android工具类之Bitmap图片处理
/** * @author Guan * @file com.guan.o2o.utils * @date 2015/9/22 * @Version 1.0 */public class BitmapUtil { /** * 将图片存储到sdcard中 * * @param bitmap * @param imageName * @原创 2015-10-01 08:55:35 · 808 阅读 · 0 评论 -
Android工具类之LogUtil
public class LogUtil { public static final int VERBOSE = 1; public static final int DEBUG = 2; public static final int INFO = 3; public static final int WARN = 4; public static final int原创 2015-09-21 11:49:20 · 1093 阅读 · 0 评论 -
Android工具类之图片流InputStream->(byte[])->Bitmap/Drawable
1、下载图片 inputStream –> drawable/** * 1、下载图片 inputStream --> drawable * * @param imageUrl * @return */ private Drawable loadDrawableImage(String imageUrl) { Drawable原创 2015-09-15 22:56:26 · 1839 阅读 · 0 评论 -
Android工具类之文件操作工具类
/** * 文件操作工具类 */public class FileUtil { /** * 在指定的位置创建指定的文件 * * @param filePath 完整的文件路径 * @param mkdir 是否创建相关的文件夹 * @throws Exception */ public static void m原创 2016-07-15 15:54:33 · 1249 阅读 · 0 评论