- 安卓笔记本 - Handler Message MessageQueue Looper
SocialException
不爱写字,一张图解决。Handler,Message,MessageQueue,Looper工作原理
- Android学习之道
sweetying
前言Android学习渠道分享,国内外最值得花时间去学习的资源,很全面,成为Android资深工程师必备1.技术公众号一些经过检测,确属干货的技术(android为主)公众号(注:搜索公众号名称关注即可)鸿洋郭霖玉刚说HenCoder刘望舒ASCE1885code小生承香墨影安卓笔记侠伯特说CodeKK安卓杂货铺安卓进化论Android那些事吴小龙同学何俊林技术视界涉及其它技术的公众号(提升眼界的
- 【安卓笔记】安卓13编译系统大包选择脚本的shell编程代码解读,巩固shell编程的知识
小李不背锅
AndroidLinuxandroid笔记
1、locala创建一个局部变量a,作用在function内。export:Shell的export命令用于将变量声明为全局变量,使其在子进程中可用。在Shell中,可以使用export命令将变量或环境变量声明为全局变量,以便在子进程中访问。例如,以下命令将变量"VAR"声明为全局变量:exportVAR=value2、echo该命令一般是输出字符串到界面,echo-e“字符串”,-e命令可以在“
- 【安卓笔记】android申请储存权限,读写文件
九狼JIULANG
安卓笔记androidjava
首先在AndroidManifest.xml中注册读取USB存储设备中的内容检查权限privatevoidcheckPermission(){try{String[]PERMISSIONS_STORAGE={Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE};intpermiss
- 【安卓笔记】解决ViewPager2嵌套RecyclerView,上下滑动冲突
九狼JIULANG
安卓笔记androidandroid-studiojava
当ViewPager2嵌套RecyclerView上下滑动的事件会被RecyclerView分发下去到ViewPager2,这样就会造成卡顿。解决办法就是重写RecyclerView的dispatchTouchEvent函数,将上滑事件拦截下来选择不分发给下一层的View自己处理。Java代码//用于标记滑动的坐标privateintdownX=0;privateintdownY=0;@Overr
- 安利一些有趣的软件和网页给你使用
Nightowls__
经验分享
分享一:学科网这是一个专门提供试卷、课件、教案等资源的网站。该网站有免费和付费资源。在这里您可以找到从小学到高中各个学科的不同版本教材的备课资料。分享二:纯纯写作纯纯写作是一款非常特别的安卓笔记应用。主打永不丢失和安全,界面简洁,使用舒适。只要你写了东西,它就永远不会丢失。无论您使用不当还是手机没电,所有历史记录都会被保存,并可以随时恢复。舒适的界面、流畅的鼠标、滑动隐藏键盘、重新调整的行距和字距
- 安卓笔记
遇见我是你最大的运气
1.即使是现在这份代码,常常也会感叹,自己没有前人做得好,有一些积累确实没有别人好,前人做的一些代码方面做得真的非常不错,跟本比不上。2.另外一个就是安卓上界面实现问题、使用什么控件、什么技术去实现(是一个积累问题,而且正常的安卓应该是展示方面做得特别多的,所以积累特别重要,这一点我非常不喜欢,靠记忆,还有就是几个布局的各种特性也要比较熟悉,总之不想这样弄。)
- 安卓笔记_1
张艾艾艾
今日收获1:判断String类型变量是否为空的方法:变量名==null||变量名.isEmpty();若为空则返回1,非空则返回0原帖:https://blog.csdn.net/qq_31939617/article/details/80629979今日收获2:如何跳出if语句?使用break语句,但是需要一个标签比如:if(buf==null||buf.isEmpty())empty:{bre
- 万安卓笔记
RichardLee123
万安卓知识点OOM如何避免OOM总结减小对象内存的占用使用更轻量级的数据结构如使用SplashArray或ArrayMap替代HashMap减少使用枚举因为枚举会默认至少占用两个静态变量的空间优化Bitmap对象的内存占用Bitmap是一个极容易消耗内存的大胖子,减小创建出来的Bitmap的内存占用可谓是重中之重,通常来说有以下2个措施:`inSampleSize`:缩放比例,在把图片载入内存之前
- 安卓笔记
luckyShan_95
设计模式:https://www.jianshu.com/p/35f76e87ac45java基础:https://xiaozhuanlan.com/topic/7548023169jvm:创建对象:https://blog.csdn.net/xiha_zhu/article/details/83614985jvm面试:https://blog.csdn.net/HarderXin/article
- 安卓笔记
天问101
一、基础控件imageTextView控件用于显示文本信息Button控件表示按钮,它继承自TextView控件,既可以显示文本,又可以显示图片,同时也允许用户通过点击来执行操作,当Button控件被点击时,被按下与弹起的背景会有一个动态的切换效果,这个效果就是点击效果。EditText表示编辑框,它是TextView的子类,用户可在此控件中输入信息。属性名功能描述android:hint控件中内
- 安卓笔记——沉浸式状态栏
_23_
安卓笔记安卓android
目录标题去掉标题栏效果步骤图片的沉浸式效果步骤去掉标题栏效果步骤1、引入依赖包implementation'com.jaeger.statusbarutil:library:1.5.1'2、去掉标题栏(轮播图那篇),设置头部颜色3、写逻辑代码,设置状态栏颜色与头部颜色相同packagecom.hnucm.chenjingshi_ztl;importandroidx.annotation.Requi
- 安卓笔记
zhj12399
安卓
安卓笔记智能手机应用类型按钮菜单右上角小菜单上下文菜单文本框拨打电话显示弹窗消息弹框界面弹框界面布局显示过长的文本实现水平居中实现水平和垂直居中使用LinearLayout使用ConstrainLayout模块集中方法实现北南中布局控件隐藏与显示ConstraintLayout动画界面的动态替换使用ViewStub动态实例化控件CountDown倒计时按钮动画设置按钮集合XXOO游戏新建另一个页面
- 【安卓笔记】热修复_addAssetPath不同版本区别原因
DrogoZhang
在做热修复功能时Java层通过反射调用addAssetPath在Android5.0及以上系统没有问题,在Android4.x版本找不到资源。addAssetPath方法:/***Addanadditionalsetofassetstotheassetmanager.Thiscanbe*eitheradirectoryorZIPfile.Notforusebyapplications.Return
- 韩老师安卓笔记
穆穆不惊左右
android
#Android教程这是一个基于Android平台开发的基础案例集。旨在用于给初学者快速了解Android平台的开发。开发工具和平台*AndroidStudio2.0以上*java语言*androidsdk*gradle2.0以上*git*github##问答####案例集面向谁?主要是面对高校以及一些对Android开发零基础的人群。##目录1.LayoutDemo关于android中布局相关案
- 安卓笔记:webView唤起QQ聊天窗口问题
宇文濠
安卓笔记
概述:今天任务给了我一串url,在浏览器中输入,可以自动唤起QQ聊天窗口,类似于客服,但是放到webView,显示网页打不开原因:url已经打开,并且实现了跳转,但是跳转在老的webview里面,并且是新的url,url可以查看图片里位于mqqwpa://xxxx,导致网页加载不出来解决方案:通过获取新的url,并且截取特性字段,在shouldOverrideUrlLoading函数里通过判断,选
- 安卓笔记-封装的HttpUtils
codes_
Android
最近项目用到了XUtils,然而由于时间紧迫一直没有进行网络请求的封装处理,导致后台返回数据方式更改后简直是灾难!于是趁着下一个项目准备之前,花点时间做下简单的封装处理,没试过性能如何,希望大家多指点指点,好了废话不多说,开始进入正题!封装类***XUtisl帮助类*@authorAdministrator**/publicclassXUtilsHelper{privatestaticContex
- 【安卓笔记】四大核心组件
看不尽的尘埃
安卓开发
Activity活动代表了一个具有用户界面的单一屏幕。三个状态:运行、停止、暂停;生命周期:回调描述onCreate()这是第一个回调,在活动第一次创建是调用onStart()这个回调在活动为用户可见时被调用onResume()这个回调在应用程序与用户开始可交互的时候调用onPause()被暂停的活动无法接受用户输入,不能执行任何代码。当当前活动将要被暂停,上一个活动将要被恢复是调用onStop(
- 安卓笔记之隐式启动Activity篇
易水南风
android基础
之前聊的关于启动Activtiy的都是在Intent对象中指明要启动哪一个Activtiy(Intent对象的构造中传参数或者Intent对象的setClass方法),这时一种显式的启动方式。其实还有一种隐式的启动方式,它不指明要开启的Activity类,而是通过匹配一些数据信息来寻找Activity。打个踢球叫人守门的比方,显式启动方式就是“xxx,你快去守门!”,隐式启动就是类似“谁以前守过门
- 安卓笔记 7.0后的 图片裁剪和拾取和相机拾取图片和裁剪 适配
丿裸奔的蜗牛
//打开相册privatevoidopenAlbum(){IntentselectIntent=newIntent(Intent.ACTION_PICK,null);selectIntent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,"image/*");OnActivityForResultUtils.startAct
- 安卓笔记 TabLayout下划线长度 修改和自定义 TabLayout的tab按钮
丿裸奔的蜗牛
工具类代码:publicclassTabLayoutUtils{/***此方法必须在这个属性下生效app:tabGravity="center"*@paramtabLayout*/publicstaticvoidreflex(finalTabLayouttabLayout){tabLayout.post(newRunnable(){@Overridepublicvoidrun(){try{//拿到
- 安卓开发中难免引入很多第三方库,当你的sdk版本COMPILESDKVERSION和引入库的版本 需要的 v4或者v7库不一样时会出现奇怪的错误
丿裸奔的蜗牛
安卓笔记:安卓开发中难免引入很多第三方库,当你的sdk版本COMPILESDKVERSION和引入库的版本需要的v4或者v7库不一样和你的编译版本COMPILESDKVERSION不匹配时会出现奇怪的错误当然大部分时候不会有这个错误但是也会影响打包速度毕竟你重复引入了很多包.这里有2种解决方式:一,升级安卓COMPILESDKVERSION的SDK版本到最新,可以向下兼容v4和v7随便啥版本都没问
- 安卓笔记---对话框中输入,判断是否符合号码规范,是--跳转拨号盘,否--提示号码不正确
Lee-Chris
安卓备忘录
新建项目后,添加一个输入框和按钮编辑activity_main.xml编辑MainActivity.javapackagecom.example.chris.telnum;importandroid.content.Intent;importandroid.net.Uri;importandroid.support.v7.app.ActionBarActivity;importandroid.os
- 安卓笔记:多媒体应用开发
欸嘿嘿嘿
音频和视频的播放Android提供了简单的API来播放音频视频,支持的音频格式有MP3,WAV,3GP等,支持的视频格式有MP4,3GP等安卓9增强的MediaPlayer略音乐特效控制使用AudioEffect及其子类略SoundPool播放音效主要用于播放一些短的声音片段。使用音效池的概念来管理多个短促的音效。与MediaPlayer相比,SoundPool的优势在于CPU资源占用量低,反映延
- 【安卓笔记】使用ViewPager+Fragment实现选项卡切换效果
rowandjj
androidandroid学习笔记
显示效果:实现过程:1.创建3个选项卡中的内容,即三个Fragment。这里仅贴出其中一个:Tab2:packagecom.example.viewpagerdemo3;importandroid.os.Bundle;importandroid.support.v4.app.Fragment;importandroid.view.LayoutInflater;importandroid.view.
- 安卓笔记之自定义广播事件发送自定义广播以及接受者优先级
皇朝青城
1.自定义广播①编写一个类继承BroadcastReciever,重写onRecieve方法。②在AndroidManifest配置文件中的application结点下配置reciever节点://优先级(优先级高的先执行)//自己定义的广播动作2.发送广播事件①创建新的工程在类中写如下关键代码Intentintent=newIntent();intent.setAction("com.wq.xx
- 【安卓笔记】—— 最基础的页面导航 Navigation
萌宅鹿
#Android笔记
安卓之页面导航Navigation实现基础的页面导航(Navigation)功能:点击按钮,从Home页面切换到Detail页面首先用AndroidStudio创建一个工程,进入工程创建两个Fragment,HomeFragment和DetailFragement创建一个名为HomeFragment的布局同理,再创建一个DetailFragment然后搭建HomeFragment的界面然后搭建De
- 【安卓笔记】—— 页面导航 Navigation(3)
萌宅鹿
#Android笔记
ViewModel、LiveData、DataBinding和Navigation的结合搭建界面创建ViewModelDataBinding绑定数据ViewModel核心作用:管理Activity中的数据使用ViewModel管理Navigation导航当中的数据,可以实现切换页面数据不丢失,架构更加清晰关于安卓搭建界面:是用图形化方式还是用代码:ConstraintLayout布局的出现,使得图
- 【安卓笔记】—— 页面导航 Navigation(2)
萌宅鹿
#Android笔记
Navigation中的数据传递和过渡动画创建一个简单的页面导航传递静态数据传递动态数据自定义动画transalate:移动scale:缩放rotate:旋转创建一个简单的页面导航首先创建两个Fragment创建HomeFragment的页面创建DetailFragment的页面创建navigation资源文件连接页面导航的逻辑在Activity_main.xml中添加NavHostFragmen
- 安卓笔记:LaunchMode
KingsonLM
Android开发
安卓中有四种加载模式:standardsingleTopsingleTasksingleInstance在AndroidManifest.xml文件中activity元素的launchMode属性中可以修改standard:standard模式,也就是默认模式,不需要配置launchMode。就是每次跳转时都需要创建该Activity的新实例,点击返回键,可以看到的是按照刚才创建Activity实
- 矩阵求逆(JAVA)初等行变换
qiuwanchi
矩阵求逆(JAVA)
package gaodai.matrix;
import gaodai.determinant.DeterminantCalculation;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* 矩阵求逆(初等行变换)
* @author 邱万迟
*
- JDK timer
antlove
javajdkschedulecodetimer
1.java.util.Timer.schedule(TimerTask task, long delay):多长时间(毫秒)后执行任务
2.java.util.Timer.schedule(TimerTask task, Date time):设定某个时间执行任务
3.java.util.Timer.schedule(TimerTask task, long delay,longperiod
- JVM调优总结 -Xms -Xmx -Xmn -Xss
coder_xpf
jvm应用服务器
堆大小设置JVM 中最大堆大小有三方面限制:相关操作系统的数据模型(32-bt还是64-bit)限制;系统的可用虚拟内存限制;系统的可用物理内存限制。32位系统下,一般限制在1.5G~2G;64为操作系统对内存无限制。我在Windows Server 2003 系统,3.5G物理内存,JDK5.0下测试,最大可设置为1478m。
典型设置:
java -Xmx
- JDBC连接数据库
Array_06
jdbc
package Util;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class JDBCUtil {
//完
- Unsupported major.minor version 51.0(jdk版本错误)
oloz
java
java.lang.UnsupportedClassVersionError: cn/support/cache/CacheType : Unsupported major.minor version 51.0 (unable to load class cn.support.cache.CacheType)
at org.apache.catalina.loader.WebappClassL
- 用多个线程处理1个List集合
362217990
多线程threadlist集合
昨天发了一个提问,启动5个线程将一个List中的内容,然后将5个线程的内容拼接起来,由于时间比较急迫,自己就写了一个Demo,希望对菜鸟有参考意义。。
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
public c
- JSP简单访问数据库
香水浓
sqlmysqljsp
学习使用javaBean,代码很烂,仅为留个脚印
public class DBHelper {
private String driverName;
private String url;
private String user;
private String password;
private Connection connection;
privat
- Flex4中使用组件添加柱状图、饼状图等图表
AdyZhang
Flex
1.添加一个最简单的柱状图
? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
<?xml version=
"1.0"&n
- Android 5.0 - ProgressBar 进度条无法展示到按钮的前面
aijuans
android
在低于SDK < 21 的版本中,ProgressBar 可以展示到按钮前面,并且为之在按钮的中间,但是切换到android 5.0后进度条ProgressBar 展示顺序变化了,按钮再前面,ProgressBar 在后面了我的xml配置文件如下:
[html]
view plain
copy
<RelativeLa
- 查询汇总的sql
baalwolf
sql
select list.listname, list.createtime,listcount from dream_list as list , (select listid,count(listid) as listcount from dream_list_user group by listid order by count(
- Linux du命令和df命令区别
BigBird2012
linux
1,两者区别
du,disk usage,是通过搜索文件来计算每个文件的大小然后累加,du能看到的文件只是一些当前存在的,没有被删除的。他计算的大小就是当前他认为存在的所有文件大小的累加和。
- AngularJS中的$apply,用还是不用?
bijian1013
JavaScriptAngularJS$apply
在AngularJS开发中,何时应该调用$scope.$apply(),何时不应该调用。下面我们透彻地解释这个问题。
但是首先,让我们把$apply转换成一种简化的形式。
scope.$apply就像一个懒惰的工人。它需要按照命
- [Zookeeper学习笔记十]Zookeeper源代码分析之ClientCnxn数据序列化和反序列化
bit1129
zookeeper
ClientCnxn是Zookeeper客户端和Zookeeper服务器端进行通信和事件通知处理的主要类,它内部包含两个类,1. SendThread 2. EventThread, SendThread负责客户端和服务器端的数据通信,也包括事件信息的传输,EventThread主要在客户端回调注册的Watchers进行通知处理
ClientCnxn构造方法
&
- 【Java命令一】jmap
bit1129
Java命令
jmap命令的用法:
[hadoop@hadoop sbin]$ jmap
Usage:
jmap [option] <pid>
(to connect to running process)
jmap [option] <executable <core>
(to connect to a
- Apache 服务器安全防护及实战
ronin47
此文转自IBM.
Apache 服务简介
Web 服务器也称为 WWW 服务器或 HTTP 服务器 (HTTP Server),它是 Internet 上最常见也是使用最频繁的服务器之一,Web 服务器能够为用户提供网页浏览、论坛访问等等服务。
由于用户在通过 Web 浏览器访问信息资源的过程中,无须再关心一些技术性的细节,而且界面非常友好,因而 Web 在 Internet 上一推出就得到
- unity 3d实例化位置出现布置?
brotherlamp
unity教程unityunity资料unity视频unity自学
问:unity 3d实例化位置出现布置?
答:实例化的同时就可以指定被实例化的物体的位置,即 position
Instantiate (original : Object, position : Vector3, rotation : Quaternion) : Object
这样你不需要再用Transform.Position了,
如果你省略了第二个参数(
- 《重构,改善现有代码的设计》第八章 Duplicate Observed Data
bylijinnan
java重构
import java.awt.Color;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.Label;
import java.awt.TextField;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusE
- struts2更改struts.xml配置目录
chiangfai
struts.xml
struts2默认是读取classes目录下的配置文件,要更改配置文件目录,比如放在WEB-INF下,路径应该写成../struts.xml(非/WEB-INF/struts.xml)
web.xml文件修改如下:
<filter>
<filter-name>struts2</filter-name>
<filter-class&g
- redis做缓存时的一点优化
chenchao051
redishadooppipeline
最近集群上有个job,其中需要短时间内频繁访问缓存,大概7亿多次。我这边的缓存是使用redis来做的,问题就来了。
首先,redis中存的是普通kv,没有考虑使用hash等解结构,那么以为着这个job需要访问7亿多次redis,导致效率低,且出现很多redi
- mysql导出数据不输出标题行
daizj
mysql数据导出去掉第一行去掉标题
当想使用数据库中的某些数据,想将其导入到文件中,而想去掉第一行的标题是可以加上-N参数
如通过下面命令导出数据:
mysql -uuserName -ppasswd -hhost -Pport -Ddatabase -e " select * from tableName" > exportResult.txt
结果为:
studentid
- phpexcel导出excel表简单入门示例
dcj3sjt126com
PHPExcelphpexcel
先下载PHPEXCEL类文件,放在class目录下面,然后新建一个index.php文件,内容如下
<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
if (PHP_SAPI == 'cli')
die('
- 爱情格言
dcj3sjt126com
格言
1) I love you not because of who you are, but because of who I am when I am with you. 我爱你,不是因为你是一个怎样的人,而是因为我喜欢与你在一起时的感觉。 2) No man or woman is worth your tears, and the one who is, won‘t
- 转 Activity 详解——Activity文档翻译
e200702084
androidUIsqlite配置管理网络应用
activity 展现在用户面前的经常是全屏窗口,你也可以将 activity 作为浮动窗口来使用(使用设置了 windowIsFloating 的主题),或者嵌入到其他的 activity (使用 ActivityGroup )中。 当用户离开 activity 时你可以在 onPause() 进行相应的操作 。更重要的是,用户做的任何改变都应该在该点上提交 ( 经常提交到 ContentPro
- win7安装MongoDB服务
geeksun
mongodb
1. 下载MongoDB的windows版本:mongodb-win32-x86_64-2008plus-ssl-3.0.4.zip,Linux版本也在这里下载,下载地址: http://www.mongodb.org/downloads
2. 解压MongoDB在D:\server\mongodb, 在D:\server\mongodb下创建d
- Javascript魔法方法:__defineGetter__,__defineSetter__
hongtoushizi
js
转载自: http://www.blackglory.me/javascript-magic-method-definegetter-definesetter/
在javascript的类中,可以用defineGetter和defineSetter_控制成员变量的Get和Set行为
例如,在一个图书类中,我们自动为Book加上书名符号:
function Book(name){
- 错误的日期格式可能导致走nginx proxy cache时不能进行304响应
jinnianshilongnian
cache
昨天在整合某些系统的nginx配置时,出现了当使用nginx cache时无法返回304响应的情况,出问题的响应头: Content-Type:text/html; charset=gb2312 Date:Mon, 05 Jan 2015 01:58:05 GMT Expires:Mon , 05 Jan 15 02:03:00 GMT Last-Modified:Mon, 05
- 数据源架构模式之行数据入口
home198979
PHP架构行数据入口
注:看不懂的请勿踩,此文章非针对java,java爱好者可直接略过。
一、概念
行数据入口(Row Data Gateway):充当数据源中单条记录入口的对象,每行一个实例。
二、简单实现行数据入口
为了方便理解,还是先简单实现:
<?php
/**
* 行数据入口类
*/
class OrderGateway {
/*定义元数
- Linux各个目录的作用及内容
pda158
linux脚本
1)根目录“/” 根目录位于目录结构的最顶层,用斜线(/)表示,类似于
Windows
操作系统的“C:\“,包含Fedora操作系统中所有的目录和文件。 2)/bin /bin 目录又称为二进制目录,包含了那些供系统管理员和普通用户使用的重要
linux命令的二进制映像。该目录存放的内容包括各种可执行文件,还有某些可执行文件的符号连接。常用的命令有:cp、d
- ubuntu12.04上编译openjdk7
ol_beta
HotSpotjvmjdkOpenJDK
获取源码
从openjdk代码仓库获取(比较慢)
安装mercurial Mercurial是一个版本管理工具。 sudo apt-get install mercurial
将以下内容添加到$HOME/.hgrc文件中,如果没有则自己创建一个: [extensions] forest=/home/lichengwu/hgforest-crew/forest.py fe
- 将数据库字段转换成设计文档所需的字段
vipbooks
设计模式工作正则表达式
哈哈,出差这么久终于回来了,回家的感觉真好!
PowerDesigner的物理数据库一出来,设计文档中要改的字段就多得不计其数,如果要把PowerDesigner中的字段一个个Copy到设计文档中,那将会是一件非常痛苦的事情。