- 博客(39)
- 资源 (11)
- 收藏
- 关注
原创 Arouter初体验-withObject传值失败
Arouter初体验-withObject传值失败附:arouter官网:https://github.com/alibaba/ARouter最近在尝试使用集成arouter组件化时,发现如下问题:记录下解决问题的过程首先花了较多时间在SerializationService这个接口实现上,分别用fastjson-1.1.17和gson-2.8.0来实现将object对象转成json字符串,最终分析出fastjson可能和我当前的kotlin版本有冲突,选用了gson解决。代码如下:pac
2021-04-30 12:05:19
719
原创 android adb offline问题解决
尝试过网上说的各种方式:adb kill-serveradb start-server重启电脑、手机也没有用最终解决的方式是在PC环境变量里面添加ANDROID_ADB_SERVER_PORT 50381(任意五位的端口号)重启电脑就可以了。怀疑是PC的端口被占用,无法识别手机设备。...
2021-02-01 14:51:10
863
原创 Android_UI开发总结(十):自动模拟按键点击事件
目的验证业务在按键点击之后,反复发起业务对app运行性能的影响;步骤1:页面oncreate时,创建Timer类和TimerTask类 timer = new Timer(); CustomTimerTask customTimerTask = new CustomTimerTask(); timer.schedule(customTimerTask,0,5000);//页面...
2019-01-28 14:25:27
2053
1
原创 Android_UI开发总结(九):MediaPlayer+SurfaceView+seekbar实现视频播放
package org.testimport android.app.Activity;import android.content.ComponentName;import android.content.Context;import android.content.Intent;import android.content.ServiceConnection;import and...
2019-01-18 10:15:34
541
原创 Android_内存泄漏总结(一):Memory Analyzer Tool & Leak Canary工具使用
Memory Analyzer工具使用Leak Canary开源框架使用1. Leak Canary项目地址2. Leak Canary介绍:LeakCanary本质上是一个基于MAT进行Android应用程序内存泄漏自动化检测的的开源工具,我们可以通过集成LeakCanary提供的jar包到自己的工程中,一旦检测到内存泄漏,LeakCanary就好dump Memory信息,并通过...
2019-01-14 11:04:49
444
原创 Android_UI开发总结(八):dialog创建总结
service中创建系统Dialog public void showDialog(String msgBody) { String msg = msgBody.substring(8, msgBody.length()); Dialog dialog = new Dialog(this, R.style.NoBgDialog, msg); ...
2019-01-14 10:12:29
277
原创 Android_开源框架总结(一):GreenDao
GreenDao开源库介绍greenDao开源库官网简单来讲,它是SQLite数据库与Java对象之间的桥梁,类似于Mybatis在SSM框架中的功能。简化了数据库的创建,编写,修改,升级等工作。是相对高效的ORM框架。GreenDao开源库配置2.1 app/build.gradleapply plugin: 'org.greenrobot.greendao'greendao ...
2018-12-29 14:11:42
294
原创 Android_UI开发总结(七):布局优化
Lint 检测如果一个FrameLayout 是整个布局的根节点,并且也没有提供背景、留白等等,那么可以使用标签来替换掉,因为DecorView本身就是一个FrameLayout。Layout Inspector如果布局中存在多余的层级嵌套,可以使用include结合merge,ViewStub进行优化。合理选择layout;如果子布局中的bg和父布局是一样的,那边可以删除...
2018-12-21 16:29:36
239
原创 数据结构与算法:leetcode_884_Uncommon Words from Two Sentences
DescriptionWe are given two sentences A and B. (A sentence is a string of space separated words. Each word consists only of lowercase letters.)A word is uncommon if it appears exactly once in on...
2018-12-07 10:03:02
226
原创 数据结构与算法:leetcode_852_Peak Index in a Mountain Array
Description Let’s call an array A a mountain if the following properties hold: A.length >= 3 There exists some 0 < i < A.length - 1 such that A[0] < A[1] < … A[i-1] < A[i] > A
2018-12-06 19:51:57
149
原创 Android_UI开发总结(六):tablayout隐藏下划线
在初始化tablayout时,可以调用setselectedTabIndicatorHeight(0)
2018-12-06 19:51:28
8987
1
原创 table configuration with catalog null schema root and table message did not resolve to any tables
最近在使用mybatis generator 工具自动生成一个dao层映射时,报如下错误,不知如果debug,求指导~具体配置文件如下:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator ...
2018-11-02 08:33:42
1688
2
原创 数据结构与算法:leetcode_557_Reverse Words in a String III
Description Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example Input: “Let’s take LeetCode ...
2018-08-03 20:02:25
182
原创 Android性能调优:apk大小优化
一方面,在发布android apk版本的时候,往往需要对apk空间进行优化。另一方面,用户在应用市场下载安装时,往往会将apk的大小作为一个考虑因素。所以合理的apk大小是必要的。近期在新项目调优时,发现apk大小较之前增加了6M多。使用Android Studio自带的apk analysis发现如下图:举例说明,优化前,drawable文件夹下面的xxhdpi占3.2M。 优...
2018-07-29 11:06:59
1758
原创 数据结构与算法:leetcode_476_Number Complement
Description Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.ExampleInput: 5Output: 2Explanation: The binary rep...
2018-07-26 21:19:54
173
原创 数据结构与算法:leetcode_867_Peak Index in a Mountain Array
Description Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it’s main diagonal, switching the row and column indices of the matrix.Example Input:...
2018-07-26 21:15:42
207
原创 数据结构与算法:leetcode_852_Peak Index in a Mountain Array
Description Let’s call an array A a mountain if the following properties hold: A.length >= 3 There exists some 0 < i < A.length - 1 such that A[0] < A[1] < … A[i-1] < A[i] > A...
2018-07-22 20:28:32
175
原创 数据结构与算法:leetcode_806_Number of Lines To Write String
Description We are to write the letters of a given string S, from left to right into lines. Each line has maximum width 100 units, and if writing a letter would cause the width of the line to exceed...
2018-07-21 22:37:20
183
原创 数据结构与算法:leetcode_804_Unique Morse Code Words
Description International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: “a” maps to “.-“, “b” maps to “-…”, “c” maps to “-.-.”, and s...
2018-07-21 22:29:49
223
原创 数据结构与算法:leetcode_771_Jewels and Stones
Description You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how m...
2018-07-21 22:22:34
177
原创 数据结构与算法:leetcode_728_Self Dividing Numbers
Description A self-dividing number is a number that is divisible by every digit it contains.For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.Also, ...
2018-07-21 22:07:04
161
原创 数据结构与算法:leetcode_657_Judge Route Circle
Description Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place.The move sequence is ...
2018-07-21 21:59:34
447
原创 数据结构与算法:leetcode_561_ Array Partition I
Description Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as l...
2018-07-21 21:47:29
147
原创 数据结构与算法:leetcode_461_Hamming Distance
Description The Hamming distance between two integers is the number of positions at which the corresponding bits are different. 0 ≤ x, y < 2’31. Given two integers x and y, calculate the Hamming...
2018-07-21 21:30:19
125
原创 数据结构与算法:leetcode_01_Two Sum
Description Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not...
2018-07-21 21:12:26
167
原创 数据结构与算法:不使用算数运算符求两个数的和
思路:这样需要用到位运算,是比较基础的算法题,mark一下。public int twoDataAddSmart(int a, int b) { int temp, d; while ((a & b) != 0) { temp = a ^ b; d = (a & b) << 1;// 需...
2018-07-21 21:01:22
298
原创 数据结构与算法:交换两个数值的三种方式
方式一: public void swap(int a, int b) { int temp; temp = b; b = a; a = temp; }方式二:public void swap(int a, int b) { a = a + b; b = a - b; ...
2018-07-21 20:49:03
1305
原创 Android_UI开发总结(五):scrollview实现页面整体滑动
这里实现的是页眉整体垂直方向滑动,xml文件较为简单,只需要在需要滑动的布局文件中包裹一层scrollview就可以实现,直接上代码:<?xml version="1.0" encoding="utf-8"?><android.support.constraint.ConstraintLayout xmlns:android="http://schemas.androi...
2018-07-07 16:19:37
8233
原创 Android_UI开发总结(四):如何调整app的字体样式不随系统变化
这里分别介绍对TextView和EditText中的hint的字体进行限制的问题。 出发点:系统给的普通字体样式(并没有加粗或者加斜线),但是仍旧显得很粗。对于textview字体样式修改限定TextView txt_title = (TextView)view.findViewById(R.id.mScrollText);txt_title.setTypeface(Typefa...
2018-07-07 16:10:44
2605
原创 Android_UI开发总结(三):ConstraintLayout中recycleview空白处点击不生效问题
先附上constraintLayout的布局文件&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&amp;lt;android.support.constraint.ConstraintLayout xmlns:android=&quot;http://schema
2018-07-07 15:31:49
2621
原创 Android_UI开发总结(二):ViewPager与TabLayout实现多个Fragment之间切换
首先重写一个TabAdapter:private class TabsAdapter extends FragmentPagerAdapter { private List&amp;lt;Fragment&amp;gt; fragmentLists; private int[] titles; private int[] imageViews; ...
2018-07-07 15:11:35
454
原创 Android_UI开发总结(一):RadioButton与RadioGroup使用
关于RadioButton与RadioGroup的API详解&gt; https://www.cnblogs.com/Im-Victor/p/6238437.html 下面记录在使用RadioButton和RadioGroup中遇到的三点问题: 1. RadioButton中如何保持文字和选择图标之间合理的间距问题。 比如上图中,要确保文字乌拉圭和选项框之间留有一定的间隔,这样UI上...
2018-07-07 14:37:04
34544
1
原创 Andriod Studio 使用技巧(一)
Android Studio中有很多开发过程中经常需要用到的功能,这里整理出来,做一个记录和汇总。大家在使用过程中遇到的一些问题,也可以评论留言大家一起提高。使用Android studio 中的favorites 如果电脑装了沙盒。关机前这个favorites需要手动保存,不然会丢失掉。办法是复制项目目录下.idea 文件下的workspace文件,一些项目相关的设置都保存在这个里面。备...
2018-05-15 20:41:26
1380
原创 Android自动化测试基础(一):monkey测试命令集
monkey自动化、随机测试是Android系统自带的测试工具,只需要通过adb工具连接手机终端,输入简单的命令,就可以做一些随机测试。 下面梳理下之前做monkey测试过程中用到的一些指令,做总结和记录。#启动monkey方式 adb shell -&gt; monkey [options] adb shell monkey [options] #kill monkey进程...
2018-05-15 20:32:46
464
原创 Android 音视频开发基础(一):音频基础
音频开发主要应用有 1.1 音频播放器,录音机,语音电话,音视频直播应用,音频编辑处理软件,蓝牙耳机、音箱等。音频开发具体内容有 2.1 音频采集与播放 2.2 音频算法处理(去噪,静音检测,回事消除,音效处理,功放/增强,混音/分离) 2.3 音频编解码和格式转换 2.4 音频传输协议的开发(SIP,A2DP, AVRCP,RTP,RTCP)音频应用的难点 3.1 延时敏感、卡...
2018-05-13 22:50:25
4077
原创 如何使Android Studio 快速编译运行代码
开启gradle 单独的守护进程 在目录C:\Users.gradle下添加gradle.properties文件,设置守护进程,编译速度9s 1. org.gradle.daemon=true 开启守护进程 2. org.gradle.parallel=true 开启并行编译 3. org.gradle.configureondemand=tr...
2018-05-13 22:35:08
18537
原创 Android Studio 快捷键(常用,持续更新)
————————————- read the fucking source code——————————– 1.shift+ctrl+a 可以查找任何需要的命令设置2.ctrl+alt+空格 可以自动补齐3.ctrl+shift+enter 可以自动补全当前表达式所缺的部分,对if else for while等语句有效。4.shift+enter可以跳入到下一行。5.使用du...
2018-05-13 22:11:35
255
原创 Android开发中遇到的错误处理汇总(持续更新)
————————————- read the fucking source code——————————– Android开发中经常会遇到一些没处理过的错误,一时也不知道怎么处理,后来通过百度才知其所以然。为了方便在Android开发过程中提高错误处理效率,特在这篇文章中汇总错误的现象及处理的办法。欢迎评论补充修正。1.Error:Unrecognized Windows Socke...
2018-05-13 21:56:17
9054
hierarchy view连接真机调试需要viewserver
2018-11-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人