- Android小知识-介绍OkHttp中的拦截器
爱读书的顾先生
本平台的文章更新会有延迟,大家可以关注微信公众号-顾林海,包括年底前会更新kotlin由浅入深系列教程,目前计划在微信公众号进行首发,如果大家想获取最新教程,请关注微信公众号,谢谢在OkHttp中执行同步请求会阻塞当前线程,直到HTTP响应返回,同步请求使用的是execute()方法;而异步请求类似于非阻塞式的请求,它的执行结果一般通过接口回调的方式告知调用者,异步请求使用的是enqueue(Ca
- Android自问自答系列——持续更新ING
浩浩的代码花园
Android开发那些事
Hello,All,我是来自58同城的一名Android开发工程师,在58集团从事APP的开发工作。在日常的工作和学习过程中我经常会碰到一些好玩的和有意思的Android小知识点,有些知识可能都从未注意到过。通过一个多月的收集和整理,我发现通过不断地记录这些问题达到了非常好的复习效果,从而帮助了工作上的持续进步,今天我也是把平时收集到的这些东西发出来供大家一起学习,共同成长,如果感觉好,欢迎点击右
- 破茧(一)GC回收机制
JuneLynn0
转眼已是而立之年,随波逐流若干年并无太大成就,目前在某信集团安安稳稳做一个PM混日子某日,突然顿悟,不愿再混吃等死,决定从新开始认识和学习陪伴自己多年的好伙伴“Android”记录下重新渡劫的点点滴滴!一、前言一直都没有深入去了解GC回收机制,对于软件开发者来说还是有必要好好研究一下的,对APP的优化起到很好的帮助。以下是参考过的文章,非常感谢各位作者!Android小知识-内存回收机制Andro
- Chronometer和CountDownTimer计时器
sean_depp
Android小知识10则(上)Android小知识10则(下)Android用5种方式实现自定义计时器,哪种才是你的菜?github传送门目录前言Chronometer的使用CountDownTimer的使用最后前言之前在Android用5种方式实现自定义计时器,哪种才是你的菜?的文章中我提到了Chronometer和CountDownTimer计时器,但是很奇怪,好像被忽略了,所以这次单独拎出
- Android小知识10则(上)(2018.8重编版)
sean_depp
Android小知识10则(下)目录前言横竖屏锁定不同分辨率的图标将字符串写在资源文件中为AlertDialog设置点击监听ProgressDialog了解一下最后前言Android的知识还是比较碎的,日常积累很重要.我把平常一些小知识点整合整合,理成了上下两篇文章,每篇五个知识点.横竖屏锁定有两种方法可以实现使用配置文件在AndroidManifest.xml的activity标签下添加andr
- Android小知识10则(下)
sean_depp
Android小知识10则(上)github传送门注:在目录中点击可以跳转到具体代码页目录Chronometer和CountDownTimer计时器Chronometer的使用CountDownTimer的使用正则表达式动态数组shape绘制矩形椭圆线环用shape绘制SeekBar最后Chronometer和CountDownTimer计时器Android也是提供了计时器的,虽然功能比较简单,但
- OKHttp同步网络请求原理分析(图文并茂,看困包赔)
浩浩的代码花园
Android开发那些事android移动开发
Hello,All,我是来自58同城的一名Android开发工程师,在58集团从事APP的开发工作。在日常的工作和学习过程中我经常会碰到一些好玩的和有意思的Android小知识点,有些知识可能都从未注意到过。通过一个多月的收集和整理,我发现通过不断地记录这些问题达到了非常好的复习效果,从而帮助了工作上的持续进步,今天我也是把平时收集到的这些东西发出来供大家一起学习,共同成长,如果感觉好,欢迎点击右
- Android小知识-剖析Retrofit中网络请求的两种方式
顾林海
本平台的文章更新会有延迟,大家可以关注微信公众号-顾林海,包括年底前会更新kotlin由浅入深系列教程,目前计划在微信公众号进行首发,如果大家想获取最新教程,请关注微信公众号,谢谢!在上一节《Android小知识-剖析Retrofit中ServiceMethod相关参数以及创建过程》介绍了动态代理类中三行核心代码的第一行,通过loadServiceMethod方法获取ServiceMethod对象
- Android小知识-Java多线程的基础知识了解下
顾林海
本平台的文章更新会有延迟,大家可以关注微信公众号-顾林海,包括年底前会更新kotlin由浅入深系列教程,目前计划在微信公众号进行首发,如果大家想获取最新教程,请关注微信公众号,谢谢!十月份离职,在家修养一个多月,这一个多月做了很多事,自己的微信公众号开通了,博客也换了一种风格,在和掘金分享一些Android方面的小知识,这一个多月看了些书,有技术相关的,也有非技术相关的,突然间觉得的这种生活也挺不
- Android小知识-定时任务ScheduledThreadPoolExecutor
顾林海
本平台的文章更新会有延迟,大家可以关注微信公众号-顾林海,包括年底前会更新kotlin由浅入深系列教程,目前计划在微信公众号进行首发,如果大家想获取最新教程,请关注微信公众号,谢谢!ScheduledThreadPoolExecutor继承自ThreadPoolExecutor,而ThreadPoolExecutor是线程池的核心实现类,用来执行被提交的任务,ScheduledThreadPool
- Android小知识-了解Android中的三种动画
爱读书的顾先生
本篇文章已授权微信公众号顾林海独家发布Android中的动画分为三种:视图动画、帧动画以及属性动画,视图动画通过对View进行图像变换(平移、缩放、旋转、透明度)从而产生动画效果,帧动画可以通过顺序播放一系列图像从而产生动画,属性动画是API11加入的,通过动态地改变对象的属性从而达到动画效果,接下来看看这三种动画的具体实现。帧动画帧动画比较简单,就是顺序播放一组预先定义好的图片,通过Animat
- Android小知识-自定义View相关知识(1)
爱读书的顾先生
本篇文章已授权微信公众号顾林海独家发布Android中的坐标系在Android中,屏幕左上角是Android坐标系的原点,向右是x轴正方向,向下是y轴正方向,通过getRawX()和getRawY()方法可以获取屏幕的坐标系,通过getX()和getY()方法可以获取手指在某个View的坐标系。通过如下方法可以获得View到其父控件的距离:getTop():获取View自身顶边到其父布局顶边的距离
- Android小知识-深入浅出Android系统启动流程(上)
爱读书的顾先生
本篇文章已授权微信公众号顾林海独家发布init进程启动过程Android系统基于Linux,init进程是Android系统中用户空间的第一个进程,进程号为1,init源代码在system/core/init目录下。既然init进程是Android系统用户空间的第一个进程,因此担负着非常重要的责任,主要负责以下两件事:解析配置init.rc,然后启动系统各种native进程,比如Zygote进程、
- android小知识
终极蛇皮怪之我上我也行
Android
打开软件安装页面一般下载完APK文件之后,都要打开软件安装页面,提示用户进行安装,可以用以下方法(固定写法)Intentintent=newIntent();intent.setAction("android.intent.action.VIEW");intent.addCategory("android.intent.category.DEFAULT");intent.setDataAndTyp
- [Android小知识]Rendering Problems The following classes could not be instantiated解决一览
bluewindtalker
android开发知识
AndroidStudio中在写XML布局文件中,可以通过右下角的Design或者Preview来预览当前的UI界面,但是有时候出现了RenderingProblemsThefollowingclassescouldnotbeinstantiated问题,网上其他的解决办法如下方法一:清除缓存并重启如图但是本方法不适用于我方法二:在style文件中theme改一下在Theme.AppCompat.
- [android小知识]clearAnimation的事件
bluewindtalker
android开发知识android动画
在开发过程中可能会遇到动画提前关闭的操作,这个时候我们就会用户clearAnimation();这个方法。但是如果动画已经启动了,这个时候就会触发newAnimation.AnimationListener()的onAnimationEnd的方法。/***测试动画调用时机*/mMoveTextOut=newTranslateAnimation(0,777,0,0);mMoveTextOut.set
- [android小知识]removeCallbacks与postDelayed的恩怨史(removeCallbacks所谓的无效, View和Handler 的postDelayed)
bluewindtalker
android开发知识android布局
常见的.postDelayed(runnable,time)方法就是常见的延迟处理的方法之一,postDelayed(mRun,time);当想要需要取消的时候,调用removeCallbacks(mRun);即可,就可以取消postDelayed的方法里面的runnable,当然如果里面runnable已经执行了,那就不可能撤回或者中止了。http://blog.csdn.net/bluewin
- 完美解决Android App启动页有白屏闪过的问题
应用启动的时候有短暂的白屏,如图:可以通过设置theme的方式来解决@color/colorPrimary@color/colorPrimaryDark@color/colorAccenttruetrue在AndroidManifest中使用AppTheme.Transparent然后重新运行程序安装。补充知识:解决Android启动页白屏及图片拉伸的问题【Android小知识】为了解决Andro
- android小知识点整理(原来的被误删了)
Loren_Wang
小知识点
1.软键盘弹出导致背景变形:LinearLayout有没在ScrollView下面?有的话,添加属性给scrollview2.进制转换1//十进制转化为十六进制,结果为C8。2Integer.toHexString(200);34//十六进制转化为十进制,结果140。5Integer.parseInt("8C",16);3.app在as上第一次安装编译启动时间慢先检查as的instantrun的状
- android小知识点ArrayList转String[]
赵凯文
android
Listlist=newArrayList();String[]arr=list.toArray(newString[]{});
- Android小知识-剖析OkHttp中的同步请求
顾林海
本平台的文章更新会有延迟,大家可以关注微信公众号-顾林海,包括年底前会更新kotlin由浅入深系列教程,目前计划在微信公众号进行首发,如果大家想获取最新教程,请关注微信公众号,谢谢无论是同步请求还是异步请求,都需要一个OkHttpClient。privateOkHttpClientmHttpClient=null;privatevoidinitHttpClient(){if(null==mHttp
- Android小知识-自定义View相关知识(1)
weixin_33975951
本篇文章已授权微信公众号顾林海独家发布Android中的坐标系在Android中,屏幕左上角是Android坐标系的原点,向右是x轴正方向,向下是y轴正方向,通过getRawX()和getRawY()方法可以获取屏幕的坐标系,通过getX()和getY()方法可以获取手指在某个View的坐标系。通过如下方法可以获得View到其父控件的距离:getTop():获取View自身顶边到其父布局顶边的距离
- Android小知识点速记
Timesongs
Android基础
1.layout_gravity:设置控件在父控件中的位置gravity:设置控件中的内容的位置2.layout_marginTop:本控件距离外面的上面某控件的距离paddingTop:在本控件内,本控件内部的东西距离本控件内边框的距离3.numColumns:设置每行显示的个数4.verticalSpacing用在GridView或者ListView之内的,设置行与行之间的距离5.view.f
- android小知识:ArrayList和数组之间的转换
code_dream_wq
android——demo
List----->数组开发中不免碰到List与数组类型之间的相互转换,举一个简单的例子:packagetest.test1;importjava.util.ArrayList;importjava.util.List;publicclassTest{/***@paramargs*/publicstaticvoidmain(String[]args){Listlist=newArrayList()
- Android小知识:apktool二次打包
mictoy_朱
android技术
工具:apktool下载地址:https://ibotpeaches.github.io/Apktool/install/原料:app-debug.apk拆包执行命令apktooldapp-debug.apk执行完该命令后,我们可以在当前目录下看到一个新生成的app-debug目录,里面就是拆包后的app相关源码和配置,其目录结构与我们的项目结构基本一样,接下来在进行打包:打包执行命令apktoo
- [android小知识]removeCallbacks与postDelayed的恩怨史(removeCallbacks所谓的无效, View和Handler 的postDelayed)...
bluewindtalker
常见的.postDelayed(runnable,time)方法就是常见的延迟处理的方法之一,postDelayed(mRun,time);当想要需要取消的时候,调用removeCallbacks(mRun);即可,就可以取消postDelayed的方法里面的runnable,当然如果里面runnable已经执行了,那就不可能撤回或者中止了。http://blog.csdn.net/bluewin
- android小知识
青鱼飞鸟20170710
Android
1、判断sd卡是否存在booleansdCardExist=Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);2、TextView部分文字设置颜色TextViewtv=newTextView(this);//添加css样式tv.setText(Html.fromHtml("红色其它颜
- android小知识(持续更新)
风少侠
[TOC]自己在开发过程中积累的一些小知识点,持续更新,留个记录。TintContextWrappercannotbecasttoActivity比如有这样一个需求,在一个view的点击事件中来操作activity的方法,假如这个点击事件写在activity外面(比如DataBinding模式中写在model里面),就像这样:publicvoidclick(Viewview){Activityac
- Android小知识——xml、shape知识点记录1
着火番茄
Android小知识
来至:http://www.2cto.com/kf/201412/358878.html(这个好像不是源,是网页抓取的吧,没找到原网页)来源:http://www.cnblogs.com/ylligang/articles/2272352.htmlgradient–对应颜色渐变。startcolor、endcolor就不多说了。android:angle是指从哪个角度开始变。solid–填充。st
- 【Android小知识点】Widget中实现动画的一种极简方式
郑Jabo
Android-随笔知识
前言Android中的Widget俗称桌面小部件;大家可能用的不多,因为除了系统应用的Widget可能会默认显示在桌面;其他第三方安装的应用都需要你长按桌面,然后点击添加小部件,选择一个放到桌面才能使用。这种手动的方式对用户来讲比较麻烦,用的很少。所以Android原生对Widget的支持其实是比比较弱的,只能显示部分系统原生的View。但是这并不能阻挡我们这些拥有发散思维而不懂技术开发的产品们。
- 继之前的线程循环加到窗口中运行
3213213333332132
javathreadJFrameJPanel
之前写了有关java线程的循环执行和结束,因为想制作成exe文件,想把执行的效果加到窗口上,所以就结合了JFrame和JPanel写了这个程序,这里直接贴出代码,在窗口上运行的效果下面有附图。
package thread;
import java.awt.Graphics;
import java.text.SimpleDateFormat;
import java.util
- linux 常用命令
BlueSkator
linux命令
1.grep
相信这个命令可以说是大家最常用的命令之一了。尤其是查询生产环境的日志,这个命令绝对是必不可少的。
但之前总是习惯于使用 (grep -n 关键字 文件名 )查出关键字以及该关键字所在的行数,然后再用 (sed -n '100,200p' 文件名),去查出该关键字之后的日志内容。
但其实还有更简便的办法,就是用(grep -B n、-A n、-C n 关键
- php heredoc原文档和nowdoc语法
dcj3sjt126com
PHPheredocnowdoc
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Current To-Do List</title>
</head>
<body>
<?
- overflow的属性
周华华
JavaScript
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml&q
- 《我所了解的Java》——总体目录
g21121
java
准备用一年左右时间写一个系列的文章《我所了解的Java》,目录及内容会不断完善及调整。
在编写相关内容时难免出现笔误、代码无法执行、名词理解错误等,请大家及时指出,我会第一时间更正。
&n
- [简单]docx4j常用方法小结
53873039oycg
docx
本代码基于docx4j-3.2.0,在office word 2007上测试通过。代码如下:
import java.io.File;
import java.io.FileInputStream;
import ja
- Spring配置学习
云端月影
spring配置
首先来看一个标准的Spring配置文件 applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi=&q
- Java新手入门的30个基本概念三
aijuans
java新手java 入门
17.Java中的每一个类都是从Object类扩展而来的。 18.object类中的equal和toString方法。 equal用于测试一个对象是否同另一个对象相等。 toString返回一个代表该对象的字符串,几乎每一个类都会重载该方法,以便返回当前状态的正确表示.(toString 方法是一个很重要的方法) 19.通用编程:任何类类型的所有值都可以同object类性的变量来代替。
- 《2008 IBM Rational 软件开发高峰论坛会议》小记
antonyup_2006
软件测试敏捷开发项目管理IBM活动
我一直想写些总结,用于交流和备忘,然都没提笔,今以一篇参加活动的感受小记开个头,呵呵!
其实参加《2008 IBM Rational 软件开发高峰论坛会议》是9月4号,那天刚好调休.但接着项目颇为忙,所以今天在中秋佳节的假期里整理了下.
参加这次活动是一个朋友给的一个邀请书,才知道有这样的一个活动,虽然现在项目暂时没用到IBM的解决方案,但觉的参与这样一个活动可以拓宽下视野和相关知识.
- PL/SQL的过程编程,异常,声明变量,PL/SQL块
百合不是茶
PL/SQL的过程编程异常PL/SQL块声明变量
PL/SQL;
过程;
符号;
变量;
PL/SQL块;
输出;
异常;
PL/SQL 是过程语言(Procedural Language)与结构化查询语言(SQL)结合而成的编程语言PL/SQL 是对 SQL 的扩展,sql的执行时每次都要写操作
- Mockito(三)--完整功能介绍
bijian1013
持续集成mockito单元测试
mockito官网:http://code.google.com/p/mockito/,打开documentation可以看到官方最新的文档资料。
一.使用mockito验证行为
//首先要import Mockito
import static org.mockito.Mockito.*;
//mo
- 精通Oracle10编程SQL(8)使用复合数据类型
bijian1013
oracle数据库plsql
/*
*使用复合数据类型
*/
--PL/SQL记录
--定义PL/SQL记录
--自定义PL/SQL记录
DECLARE
TYPE emp_record_type IS RECORD(
name emp.ename%TYPE,
salary emp.sal%TYPE,
dno emp.deptno%TYPE
);
emp_
- 【Linux常用命令一】grep命令
bit1129
Linux常用命令
grep命令格式
grep [option] pattern [file-list]
grep命令用于在指定的文件(一个或者多个,file-list)中查找包含模式串(pattern)的行,[option]用于控制grep命令的查找方式。
pattern可以是普通字符串,也可以是正则表达式,当查找的字符串包含正则表达式字符或者特
- mybatis3入门学习笔记
白糖_
sqlibatisqqjdbc配置管理
MyBatis 的前身就是iBatis,是一个数据持久层(ORM)框架。 MyBatis 是支持普通 SQL 查询,存储过程和高级映射的优秀持久层框架。MyBatis对JDBC进行了一次很浅的封装。
以前也学过iBatis,因为MyBatis是iBatis的升级版本,最初以为改动应该不大,实际结果是MyBatis对配置文件进行了一些大的改动,使整个框架更加方便人性化。
- Linux 命令神器:lsof 入门
ronin47
lsof
lsof是系统管理/安全的尤伯工具。我大多数时候用它来从系统获得与网络连接相关的信息,但那只是这个强大而又鲜为人知的应用的第一步。将这个工具称之为lsof真实名副其实,因为它是指“列出打开文件(lists openfiles)”。而有一点要切记,在Unix中一切(包括网络套接口)都是文件。
有趣的是,lsof也是有着最多
- java实现两个大数相加,可能存在溢出。
bylijinnan
java实现
import java.math.BigInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class BigIntegerAddition {
/**
* 题目:java实现两个大数相加,可能存在溢出。
* 如123456789 + 987654321
- Kettle学习资料分享,附大神用Kettle的一套流程完成对整个数据库迁移方法
Kai_Ge
Kettle
Kettle学习资料分享
Kettle 3.2 使用说明书
目录
概述..........................................................................................................................................7
1.Kettle 资源库管
- [货币与金融]钢之炼金术士
comsci
金融
自古以来,都有一些人在从事炼金术的工作.........但是很少有成功的
那么随着人类在理论物理和工程物理上面取得的一些突破性进展......
炼金术这个古老
- Toast原来也可以多样化
dai_lm
androidtoast
Style 1: 默认
Toast def = Toast.makeText(this, "default", Toast.LENGTH_SHORT);
def.show();
Style 2: 顶部显示
Toast top = Toast.makeText(this, "top", Toast.LENGTH_SHORT);
t
- java数据计算的几种解决方法3
datamachine
javahadoopibatisr-languer
4、iBatis
简单敏捷因此强大的数据计算层。和Hibernate不同,它鼓励写SQL,所以学习成本最低。同时它用最小的代价实现了计算脚本和JAVA代码的解耦,只用20%的代价就实现了hibernate 80%的功能,没实现的20%是计算脚本和数据库的解耦。
复杂计算环境是它的弱项,比如:分布式计算、复杂计算、非数据
- 向网页中插入透明Flash的方法和技巧
dcj3sjt126com
htmlWebFlash
将
Flash 作品插入网页的时候,我们有时候会需要将它设为透明,有时候我们需要在Flash的背面插入一些漂亮的图片,搭配出漂亮的效果……下面我们介绍一些将Flash插入网页中的一些透明的设置技巧。
一、Swf透明、无坐标控制 首先教大家最简单的插入Flash的代码,透明,无坐标控制: 注意wmode="transparent"是控制Flash是否透明
- ios UICollectionView的使用
dcj3sjt126com
UICollectionView的使用有两种方法,一种是继承UICollectionViewController,这个Controller会自带一个UICollectionView;另外一种是作为一个视图放在普通的UIViewController里面。
个人更喜欢第二种。下面采用第二种方式简单介绍一下UICollectionView的使用。
1.UIViewController实现委托,代码如
- Eos平台java公共逻辑
蕃薯耀
Eos平台java公共逻辑Eos平台java公共逻辑
Eos平台java公共逻辑
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
蕃薯耀 2015年6月1日 17:20:4
- SpringMVC4零配置--Web上下文配置【MvcConfig】
hanqunfeng
springmvc4
与SpringSecurity的配置类似,spring同样为我们提供了一个实现类WebMvcConfigurationSupport和一个注解@EnableWebMvc以帮助我们减少bean的声明。
applicationContext-MvcConfig.xml
<!-- 启用注解,并定义组件查找规则 ,mvc层只负责扫描@Controller -->
<
- 解决ie和其他浏览器poi下载excel文件名乱码
jackyrong
Excel
使用poi,做传统的excel导出,然后想在浏览器中,让用户选择另存为,保存用户下载的xls文件,这个时候,可能的是在ie下出现乱码(ie,9,10,11),但在firefox,chrome下没乱码,
因此必须综合判断,编写一个工具类:
/**
*
* @Title: pro
- 挥洒泪水的青春
lampcy
编程生活程序员
2015年2月28日,我辞职了,离开了相处一年的触控,转过身--挥洒掉泪水,毅然来到了兄弟连,背负着许多的不解、质疑——”你一个零基础、脑子又不聪明的人,还敢跨行业,选择Unity3D?“,”真是不自量力••••••“,”真是初生牛犊不怕虎•••••“,••••••我只是淡淡一笑,拎着行李----坐上了通向挥洒泪水的青春之地——兄弟连!
这就是我青春的分割线,不后悔,只会去用泪水浇灌——已经来到
- 稳增长之中国股市两点意见-----严控做空,建立涨跌停版停牌重组机制
nannan408
对于股市,我们国家的监管还是有点拼的,但始终拼不过飞流直下的恐慌,为什么呢?
笔者首先支持股市的监管。对于股市越管越荡的现象,笔者认为首先是做空力量超过了股市自身的升力,并且对于跌停停牌重组的快速反应还没建立好,上市公司对于股价下跌没有很好的利好支撑。
我们来看美国和香港是怎么应对股灾的。美国是靠禁止重要股票做空,在
- 动态设置iframe高度(iframe高度自适应)
Rainbow702
JavaScriptiframecontentDocument高度自适应局部刷新
如果需要对画面中的部分区域作局部刷新,大家可能都会想到使用ajax。
但有些情况下,须使用在页面中嵌入一个iframe来作局部刷新。
对于使用iframe的情况,发现有一个问题,就是iframe中的页面的高度可能会很高,但是外面页面并不会被iframe内部页面给撑开,如下面的结构:
<div id="content">
<div id=&quo
- 用Rapael做图表
tntxia
rap
function drawReport(paper,attr,data){
var width = attr.width;
var height = attr.height;
var max = 0;
&nbs
- HTML5 bootstrap2网页兼容(支持IE10以下)
xiaoluode
html5bootstrap
<!DOCTYPE html>
<html>
<head lang="zh-CN">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">