随笔分类 -  Android

摘要: 阅读全文
posted @ 2014-04-29 10:39 bingoogolapple 阅读(149) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2014-04-17 17:39 bingoogolapple 阅读(502) 评论(0) 推荐(0)
摘要:屏幕密度(每寸像素:ldpi-120/mdpi-160/hdpi-240/xhdpi-320)3:4:6:8DisplayMetrics dm = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(dm);三... 阅读全文
posted @ 2014-04-09 14:31 bingoogolapple 阅读(324) 评论(0) 推荐(0)
摘要:AccelerateDecelerateInterpolator先加速再减速AccelerateInterpolator加速AnticipateInterpolator先回退一小步,然后再迅速前进AnticipateOvershootInterpolator先回退一小步,然后再迅速前进,在超过右边界一小步BounceInterpolator实现弹球效果CycleInterpolator周期运动DecelerateInterpolator 减速LinearInterpolator匀速OvershootInterpolator快速前进到右边界上,再往外突出一小步 阅读全文
posted @ 2014-04-09 13:28 bingoogolapple 阅读(197) 评论(0) 推荐(0)
摘要:android:inputType="none"--输入普通字符android:inputType="text"--输入普通字符android:inputType="textCapCharacters"--输入普通字符android:inputType="textCapWords"--单词首字母大小android:inputType="textCapSentences"--仅第一个字母大小android:inputType="textAutoCorrect"--前两个自动完成 阅读全文
posted @ 2014-04-08 10:04 bingoogolapple 阅读(155) 评论(0) 推荐(0)
摘要:public class DensityUtil { /** * 根据手机的分辨率从 dip 的单位 转成为 px(像素) */ public static int dip2px(Context context, float dpValue) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (dpValue * scale + 0.5f); } /** * ... 阅读全文
posted @ 2014-04-07 13:02 bingoogolapple 阅读(301) 评论(0) 推荐(0)
摘要:PTRListView.javapublic class PTRListView extends ListView implements OnScrollListener { private static final int PULL_TO_REFRESH = 0; private static final int RELEASE_TO_REFRESH = 1; private static final int REFRESHING = 2; private static final int DONE = 3; // view组件 private View ... 阅读全文
posted @ 2014-04-01 17:24 bingoogolapple 阅读(340) 评论(0) 推荐(0)
摘要:/** * 文件操作工具类 * * @author bingoogol@sina.com 14-1-25. */public class StorageUtil { private StorageUtil() { } /** * 判断外部存储是否可写 * * @return */ public static boolean isExternalStorageWritable() { return Environment.getExternalStorageState().equals(Environment.MEDIA_MO... 阅读全文
posted @ 2014-03-26 16:58 bingoogolapple 阅读(281) 评论(0) 推荐(0)
摘要:public class NetUtil { private NetUtil() { } /** * 获取ip前缀 * * @return */ public static String getLocalIpAddressPrefix(Context context) { String ipAddress = getLocalIpAddress(context); return ipAddress.substring(0, ipAddress.lastIndexOf(".") + 1); } /*... 阅读全文
posted @ 2014-03-26 16:53 bingoogolapple 阅读(275) 评论(0) 推荐(0)
摘要:/** * 日志记录工具类 * * @author bingoogol@sina.com 2014-2-18 */public class Logger { private Logger() { } // 日志记录级别,开发阶段根据需求设置成大于0的数,项目正式发布后设置成0 private static int LOGLEVEL = 6; private static int ERROR = 1; private static int WARN = 2; private static int INFO = 3; private static ... 阅读全文
posted @ 2014-03-26 16:51 bingoogolapple 阅读(147) 评论(0) 推荐(0)
摘要:/** * 吐丝工具类 * * @author bingoogol@sina.com 2014-2-18 */public class ToastUtil { private ToastUtil() { } /** * 根据文本打印吐丝 * * @param context * 应用程序上下文 * @param text * 要显示的文本 */ public static void makeText(Context context, CharSequence text... 阅读全文
posted @ 2014-03-26 16:49 bingoogolapple 阅读(136) 评论(0) 推荐(0)
摘要:/** * * SharedPreferences工具类,使用前必须先初始化,最好在Application的onCreate方法里初始化 * * @author bingoogol@sina.com 2014-3-6 */public class SpUtil { private static SpUtil instance = new SpUtil(); private static SharedPreferences mSp; private SpUtil() { } public static SpUtil getInstance() { ... 阅读全文
posted @ 2014-03-26 16:47 bingoogolapple 阅读(251) 评论(0) 推荐(0)
摘要:1.apktool 下载a.将apk文件和apktool.jar放在同一目录b.在命令行跳转到a中所述目录,执行java -jar apktool.jar d xxx.apk到此,已经获取到清单文件和资源文件,但是并没获取到xxx.dex文件2.dex2jar 下载a.用压缩工具解压xxx.apk文件中的xxx.dex文件b.将xxx.dex文件拷贝到dex2jar目录下c.在命令行跳转到a中所述目录,执行dex2jar.bat xxx.dex(Windows) ./dex2jar.sh xxx.dex(Ubuntu)到此就得到了xxx.jar文件3.jd jui 下载运行jd-gui... 阅读全文
posted @ 2014-03-12 12:23 bingoogolapple 阅读(158) 评论(0) 推荐(0)
摘要:overridePendingTransition(R.anim.tran_pre_in, R.anim.tran_pre_out);tran_pre_in.xmltran_pre_out.xmloverridePendingTransition(R.anim.tran_next_in, R.anim.tran_next_out);tran_next_in.xmltran_next_out.xml 阅读全文
posted @ 2014-03-05 22:16 bingoogolapple 阅读(93) 评论(0) 推荐(0)
摘要:1. SystemClock.uptimeMillis() // 从开机到现在的毫秒数(手机睡眠的时间不包括在内);2. System.currentTimeMillis() // 从1970年1月1日 UTC到现在的毫秒数;//全局变量long[] mHits = new long[2];//OnClickListener中/*public static void arraycopy (Object src, int srcPos, Object dst, int dstPos, int length)Added in API level 1Copies length elements fr 阅读全文
posted @ 2014-03-05 21:58 bingoogolapple 阅读(181) 评论(0) 推荐(0)
摘要:在安卓开发中,通常需要去掉Activity的头部标题栏,而且在欢迎界面需要全屏显示推荐使用方案二方案一:通过Java代码的方式实现以上要求在onCreate方法内加入下面这句去掉Activity的头部标题栏requestWindowFeature(Window.FEATURE_NO_TITLE); 在onCreate方法内加入下面这句全屏显示getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 重构方案:将requestWin.. 阅读全文
posted @ 2014-02-09 21:03 bingoogolapple 阅读(1744) 评论(1) 推荐(0)
摘要:bingo是我的个人主文件夹的名字,根据自己的情况替换成其他名字在执行以下操作之前先安装java,Ubuntu下搭建Java开发环境参考http://www.cnblogs.com/bingoogol/p/ubuntu-environment-java.html1.到官网下载sdk(这里我下载的是a... 阅读全文
posted @ 2013-11-16 16:12 bingoogolapple 阅读(306) 评论(0) 推荐(0)