- 博客(17)
- 资源 (20)
- 问答 (1)
- 收藏
- 关注
原创 架构-伸缩性-扩展性-高可用的学习
高可用系统: 1 利用负载均衡做集群并且利用负载均衡进行无状态服务的转移 2 session管理:1 session复制 2Session绑定 3 Cookie记录Session 4 Session服务器 3、数据备份:数据冷备,数据热备(异步热备和同步热备)。关系型数据库通常热备机制为设置主从数据库 4、失效转移:失效确认、访问转移、数据恢复 (当数据库不可...
2015-07-31 10:42:19 322
原创 架构优化-前端与应用
一、前端优化:浏览器访问、反向代理、CDN(内容分发网络,静态文件缓存)二、浏览器访问: 1、减少HTTP请求,包括合并css、合并js、合并图像文件(通过合并减少请求文件数量)2、使用浏览器缓存(静态文件)3、启用文件压缩GZIP,减小文件大小4、css文件放上面,js文件放下面, 因为css文件加载完后就会渲染页面,放在上面会加快页面渲染 js文...
2015-07-27 15:36:33 86
架构演化-初识
以下是自己的一点理解,如有理解有误的地方欢迎指出,不胜感谢。 1 网站建设初期,用户和访问量都非常小,应用服务+数据库+文件服务全都在一个服务器中2 用户和访问量增大,应用服务器计算效率不够,文件服务存储量不够,数据库内存和硬盘需求不够 导致问题的原因是所有服务都在一个服务器上,用多台服务器来解决问题,出现 应用服务器+数据库服务器+文件服务器 应用服务器要逻辑计算...
2015-07-27 10:08:09 72
原创 流布局Flowlayoiut
整个的原理同 : http://username2.iteye.com/admin/blogs/2229583 直接上代码: 1 ViewGroup 的使用/** * 个人理解,容器的布局执行过程 1 父容器调用measureChildren 2 子容器调用measure 计算当前容器的宽高和其子容器的宽高 3 * 当前执行的这个子容器触发onMeasure ,设置当前子...
2015-07-23 14:54:26 83
原创 自定义ViewGroup
一、个人理解,容器的布局执行过程 * 1 父容器调用measureChildren * 2 子容器调用measure 计算当前容器的宽高和其子容器的宽高 * 3 当前执行的这个子容器触发onMeasure ,设置当前子容器的宽高 * 4 当前容器调用onLayout , 来展示当前容器的显示 二、自定义布局: 1 ViewGroup职责为:...
2015-07-23 11:13:51 64
原创 LruCache实现图片缓存
1 图片的加载通常会导致OOM异常: 处理: 1) 计算图片可能得压缩比例 (inSampleSize压缩比例) 2)将图片压缩 3 )计算应用程序可能得到的最大内存,实例化LruCache,并赋予适当的缓存空间 原理:把最近使用的对象用强引用存储在 LinkedHashMap 中,并且把最近最少使用的对象在缓存值达到预设定值之前从内存中移除 ...
2015-07-22 14:02:02 141
原创 AsyncTask使用和带有进度条的下载
1 AsyncTask 用来执行比较耗时的异步任务,默认同时开启N个任务,则按顺序执行,需要并发则需要特殊设置 2 AsyncTask中泛型的三个参数:* 第一个参数:传入doInBackground()方法的参数类型 ,下载任务通常传Url地址* 第二个参数:传入onProgressUpdate()方法的参数类型,通过publishProgress每次将数据传入...
2015-07-22 10:46:33 222
原创 ListView中Checkbox的使用
1 Listview item中加入checkbox后onListItemClick 事件无法触发2 实现点击item则选中checkbox 3 item重用的时候,checkbox选中状态会混乱,需要用另一个容器记录复选框的选中状态 问题1原因:checkbox的优先级高于ListItem于是屏蔽了ListItem的单击事件。解决:android:fo...
2015-07-17 17:03:45 242
原创 Fragment 中的Fragment内容不加载
利用 Fragment创建滑动Tab页面的时候FragmentPagerAdapter需要设置FragmentManager 因为是Fragment嵌套结构如果这个FragmentManager 使用getChildFragmentManager则正确如果用getFragmentManager则会出现pager中内容不加载的情况...
2015-07-16 11:28:37 169
原创 TextView显示Html(带有网络图片)
网路图片加载方法:1 ImageGetter中判断图片是否已经加载过,如果本地已经存在直接从本地加载2 图片本地不存在,开启线程加载图片,下载完毕后,重新调用ImageGetter加载图片 主要代码: 1 TextView加载html htmlText4 = (TextView) findViewById( R.id.htmlText4); Spanned...
2015-07-14 18:28:25 568
原创 个人对Android开发框架的理解
下面是个人理解,欢迎大牛们给予指导性建议。 1 MVC V 视图层,个人认为xml即为视图层的表现 C为控制层,Activity启的作用,只写一些简单的逻辑处理,真正的处理放到M层 Activity之间跳转写到专门的类中进行管理(UIHelper)M为model,是访问网络接口的地方,如果数据为非及时性数据,最好做个缓存 每次从缓存中取...
2015-07-07 10:39:55 98
原创 Android双击退出
思路:监听手机上的返回键,点击第一下记录,2s内点击第二下则退出,否则调用handler还原第一次点击的标志位 1 配置权限2 onKey中调用 <uses-permission android:name="android.permission.RESTART_PACKAGES" /> import android.app....
2015-07-07 10:05:39 62
原创 属性文件-保存个人设置
Android中信息保存有三种方法:1 SharePreferences 2 文件保存 3 数据库存储 但现在个人还没找到 他们中每个有什么特殊的的用途,好像东西用他们每一个都能存储,也都能持久存储 有高手略过欢迎给予指点,多谢。 /** * 应用程序配置类:用于保存用户相关信息及设置 * 用属性文件来保存一些基本信息 * ...
2015-07-06 11:15:31 100
原创 Android事情记载
1 弹出框实现原理: 利用Dialog实现显示,然后背景透明 显示位置利用对话框的window的x和y属性来设置 通过setCanceledOnTouchOutside设置点击对话框外面,对话框是否消失 2 下载对话框以及进度条 下载附件其实就是利用URLConnection建立附件链接,然后拿到附件总大小 利用流,不断的读取数据然后...
2015-07-03 18:34:45 57
原创 Quick Dialog选择框
弹出框,典型应用为社区中微博、QQ的分享弹出框。 实现原理: 利用Dialog实现显示,然后背景透明 显示位置利用对话框的window的x和y属性来设置 通过setCanceledOnTouchOutside设置点击对话框外面,对话框是否消失 ...
2015-07-03 17:50:04 140
原创 Bitmap、文件、流之间的转换
个人觉得,文件和Bitmap转换基本上都是通过流作为中间转换处理的。 1 根据文件路径得到Bitmap对象 BitmapFactory.decodeStream(FileInputStream, null, BitmapFactory.Options); BitmapFactory.decodeFile(String pathName, Bit...
2015-07-01 18:56:48 1264
原创 设置头像与背景图片
整个过程中遇到的问题 一、 显示选择对话框,操作选择 问题1:为了解决Activity之间跳转,有黑色背景出现,添加了透明背景的Theme:windowIsTranslucent 问题2:添加后弹出框的title背景变黑(因为样式的parent不是AppBaseTheme后来改回来就好了) 问题3:选择图片后中间跳转到桌面,然后才弹回到activit...
2015-07-01 17:14:06 298
power designer 15破解文件
2012-11-23
jquery-validation 校验框架
2012-06-04
WebLogicServer11gCluster_SingleMachine.rar
2011-10-11
Expert One-on-One J2EE Design and Development
2011-10-11
overflow 溢出部分不隐藏
2013-07-22
TA创建的收藏夹 TA关注的收藏夹
TA关注的人