摘要: socket编程 1.连接超时connect(socketAddresss,timeout) //这个超时是连接的时候超时,及tcp三次握手的超时 2.读超时socket的read操作是阻塞的,当serversocker奔溃或者异常关闭时,未通知客户端socket,所以该socket线程会一直阻塞, 阅读全文
posted @ 2016-09-09 09:52 x-bing 阅读(1292) 评论(0) 推荐(0) 编辑
摘要: /** * TODO filePath:图片路径 */public Bitmap compressToBitmap(String filePath) { final BitmapFactory.Options options = new BitmapFactory.Options(); option 阅读全文
posted @ 2016-07-29 09:13 x-bing 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 前几天遇到的问题,app升级的时候,如果数据库结构有变化,该如何升级数据库? 首先我们来看看数据库的创建过程: 1、当我们在使用数据库时会调用getWritableDatabase()和getReadableDatabase()方法,而他们都调用了同一个方法getDatabaseLocked(fal 阅读全文
posted @ 2016-07-13 11:15 x-bing 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-06-24 10:15 x-bing 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 1、 InputMethodManager imm = (InputMethodManager) getActivity() .getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(0, InputMethodMana 阅读全文
posted @ 2016-06-22 14:07 x-bing 阅读(249) 评论(0) 推荐(0) 编辑
摘要: package com.xbing.com.viewdemo;import android.animation.AnimatorSet;import android.animation.ObjectAnimator;import android.animation.ValueAnimator;imp 阅读全文
posted @ 2016-06-21 10:55 x-bing 阅读(863) 评论(0) 推荐(0) 编辑
摘要: 在两种情况下,我们会遇到这种问题: 1.当前activity关闭时,还有ProgressDialog在show() 这种情况只需要关闭即可 if (progressDialog != null && progressDialog.isShowing()){ progressDialog.dismis 阅读全文
posted @ 2016-06-17 17:22 x-bing 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 1.可以使用第三方文本编辑工具 notepad++,ue等 将文件格式转换 注意:android studio 默认使用的是UTF-8 无bom格式 ,所以不要只转换为UTF-8,依旧报错 阅读全文
posted @ 2016-06-15 15:17 x-bing 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-06-15 15:09 x-bing 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 1.配置build.gradle脚本中buildTypes节点 buildTypes { debug { debuggable true signingConfig signingConfigs.config } release { minifyEnabled true proguardFiles 阅读全文
posted @ 2016-05-06 10:59 x-bing 阅读(585) 评论(0) 推荐(0) 编辑