Android ImageView 的scaleType 属性图解: https://www.jianshu.com/p/32e335d5b842 ListView、RecyclerView等添加头尾布局: https://github.com/Aspsine/SwipeToLoadLayout/wiki http://blog.csdn.net/lisdye2/article/details/51384159 https://github.com/Chanven/CommonPullToRefresh Android 软键盘弹出时把原来布局顶上去的解决方法: http://www.jb51.net/article/101905.htm 关于ArrayList的简单使用: http://www.cnblogs.com/rickie/articles/67978.html Android版本更新: http://blog.csdn.net/harvic880925/article/details/25191159 http://blog.csdn.net/wenzhi20102321/article/details/62044892 Android怎样跳转至临时QQ聊天界面: http://blog.csdn.net/qq_28484355/article/details/52959623?locationNum=2&fps=1 关于Android Hook: http://blog.csdn.net/zoudifei/article/details/49871065 高德,百度,Google地图定位偏移以及坐标系转换: http://blog.csdn.net/a13570320979/article/details/51366355 自适应Tab宽度可以滑动文字逐渐变色的TabLayout: http://blog.csdn.net/yewei02538/article/details/70214251 关于渐变和图形渲染:(博客) http://blog.csdn.net/t12x3456?viewmode=contents Android的各个版本信息: http://www.apkbus.com/thread-463339-1-1.html Android 中跳转至系统设置界面大全: http://xp9802.iteye.com/blog/2095367 (找这个东西太费劲了,找了好久没看到直接跳转至系统位置信息的,想cry) (eg:直接跳转至系统位置信息设置界面!!!!!! Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivity(intent);) 对线程池的理解: https://www.jianshu.com/p/210eab345423 Android 打包过程: Android打包过程 Android开发——JVM、Dalvik以及ART的区别 : http://blog.csdn.net/seu_calvin/article/details/52354964 热修复: https://blog.csdn.net/csdn_lqr/article/details/78534065 adb突然间多次停止运行:(2018.12.28出现问题,找了很多解决方法,最后换adb版本就行了) https://blog.csdn.net/HANNING563128766/article/details/79616179 知乎图片选择器开源框架: https://github.com/zhihu/Matisse 动态权限申请 https://blog.csdn.net/yanzhenjie1003/article/details/52503533 一个非常强大的日历控件:CalendarView https://github.com/huanghaibin-dev/CalendarView 开源图标库hellocharts常见API总结: https://www.jianshu.com/p/7e8de03dad79 hellocharts实现y轴固定和x轴滑动效果: https://blog.csdn.net/xiao22long/article/details/72519373 Material Design——控件大汇总 https://blog.csdn.net/Fly_li_sir/article/details/79704021
package com.rx.rxhm.utils;
/** * @author SHANG01 * GPS坐标转换基础函数集合 */ public class CoordMath { private final static double PI = 3.14159265358979324; private final static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; /** * WGS84转GCJ02 * * @param point WGS84 * @return */ public static MyLatLngPoint wgs2gcj(MyLatLngPoint point) { MyLatLngPoint newpt; if (isOutOfChina(point)) { return point; } MyLatLngPoint d = delta(point); newpt = new MyLatLngPoint(point.getLat() + d.getLat(), point.getLng() + d.getLng()); return newpt; } /** * 国测局转WGS84 * * @param point * @return */ public static MyLatLngPoint gcj2wgs(MyLatLngPoint point) { double gcjLat = point.getLat(); double gcjLon = point.getLng(); double initDelta = 0.01; double threshold = 0.000000001; double dLat = initDelta; double dLon = initDelta; double mLat = gcjLat - dLat; double mLon = gcjLon - dLon; double pLat = gcjLat + dLat; double pLon = gcjLon + dLon; double wgsLat; double wgsLon; int i = 0; while (true) { wgsLat = (mLat + pLat) / 2; wgsLon = (mLon + pLon) / 2; MyLatLngPoint tmp = gcj2wgs(new MyLatLngPoint(wgsLat, wgsLon));//gcj_encrypt dLat = tmp.getLat() - gcjLat; dLon = tmp.getLng() - gcjLon; if ((Math.abs(dLat) < threshold) && (Math.abs(dLon) < threshold)) break; if (dLat > 0) pLat = wgsLat; else mLat = wgsLat; if (dLon > 0) pLon = wgsLon; else mLon = wgsLon; if (++i > 10000) break; } //console.log(i); return new MyLatLngPoint(wgsLat, wgsLon); } /** * 国测局转百度 * * @param point * @return */ public static MyLatLngPoint gcj2bd(MyLatLngPoint point) { double gcjLon = point.getLng(); double gcjLat = point.getLat(); double x = gcjLon; double y = gcjLat; double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi); double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi); double bdLon = z * Math.cos(theta) + 0.0065; double bdLat = z * Math.sin(theta) + 0.006; return new MyLatLngPoint(bdLat, bdLon); } /** * 百度转国测局 * 百度转国策局 * @param point * @return */ public static MyLatLngPoint bd2gcj(MyLatLngPoint point) { double bdLon = point.getLng(); double bdLat = point.getLat(); double x = bdLon - 0.0065; double y = bdLat - 0.006; double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi); double gcjLon = z * Math.cos(theta); double gcjLat = z * Math.sin(theta); return new MyLatLngPoint(gcjLat, gcjLon);//{'lat' : gcjLat, 'lon' : gcjLon}; } /** * wgs转百度 * * @param point * @return */ public static MyLatLngPoint wgs2bd(MyLatLngPoint point) { //wgs--gcj MyLatLngPoint gcjpt = wgs2gcj(point); //gcj--bd return gcj2bd(gcjpt); } /** * 百度转wgs * * @param point * @return */ public static MyLatLngPoint bd2wgs(MyLatLngPoint point) { //bd---gcj MyLatLngPoint gcjpt = bd2gcj(point); //gcj--wgs return gcj2wgs(gcjpt); } private static boolean isOutOfChina(MyLatLngPoint point) { if (point.getLng() < 72.004 || point.getLng() > 137.8347) return true; if (point.getLat() < 0.8293 || point.getLat() > 55.8271) return true; return false; } private static MyLatLngPoint delta(MyLatLngPoint point) { MyLatLngPoint d; double a = 6378245.0;// a: 卫星椭球坐标投影到平面地图坐标系的投影因子。 double ee = 0.00669342162296594323; // ee: 椭球的偏心率。 double dlat; double dlng; double radlat; double magic; double sqrtmagic; dlat = transformLat(point.getLng() - 105.0, point.getLat() - 35.0); dlng = transformLon(point.getLng() - 105.0, point.getLat() - 35.0); radlat = point.getLat() / 180.0 * PI; magic = Math.sin(radlat); magic = 1 - ee * magic * magic; sqrtmagic = Math.sqrt(magic); dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI); dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI); d = new MyLatLngPoint(dlat, dlng); return d; } private static double transformLat(double x, double y) { double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x)); ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0; ret += (20.0 * Math.sin(y * PI) + 40.0 * Math.sin(y / 3.0 * PI)) * 2.0 / 3.0; ret += (160.0 * Math.sin(y / 12.0 * PI) + 320 * Math.sin(y * PI / 30.0)) * 2.0 / 3.0; return ret; } private static double transformLon(double x, double y) { double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x)); ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0; ret += (20.0 * Math.sin(x * PI) + 40.0 * Math.sin(x / 3.0 * PI)) * 2.0 / 3.0; ret += (150.0 * Math.sin(x / 12.0 * PI) + 300.0 * Math.sin(x / 30.0 * PI)) * 2.0 / 3.0; return ret; } }关于java 8 lambdam
遇到的bug: 打开Android自带的虚拟机出现 Device supports x86,but APK only supports armeabi-v7a,armeabi,x86_64; 解决:http://blog.csdn.net/qq_32452623/article/details/71076023
我国当前的身份证号分为三种: 一、15位身份证号 二、18位身份证号(前17位位数字,最后一位为字母x) 三、18为身份证号(18位都是数字) 正则表达式判断代码如下:
/** * 验证身份证号是否符合规则 * @param text 身份证号 * @return */ public boolean personIdValidation(String text) { String regx = "[0-9]{17}x"; String reg1 = "[0-9]{15}"; String regex = "[0-9]{18}"; return text.matches(regx) || text.matches(reg1) || text.matches(regex); }根据某个时间戳,计算一个月之后的某个时间/时间戳:
(new Date(endDate + 1000L * 3600 * 24 * 30)).getTime() //1000L 这里把数据改成long是因为如果是int,会造成数据过大,超过int的最大值。Android的动画系列教程(非常好): https://github.com/OCNYang/Android-Animation-Set
Android刘海屏适配: https://blog.csdn.net/xiaoqiang_0719/article/details/80844519
Android中注解的使用: https://blog.csdn.net/briblue/article/details/73824058/
百度地图显示网格不展示地图: 1.key错了 2.key有很多种模式用的,你直接运行的时候用的正式key,或者反过来了