- 博客(229)
- 资源 (1)
- 收藏
- 关注
转载 Android开发中为什么有人坚持不用JavaBean规范的set、get函数
作者:杨博链接:https://www.zhihu.com/question/19773379/answer/31625054来源:知乎著作权归作者所有,转载请联系作者获得授权。Java语言欠缺属性、事件、多重继承功能。所以,如果要在Java程序中实现一些面向对象编程的常见需求,只能手写大量胶水代码。Java Bean正是编写这套胶水代码的惯用模式或约定。这些约定包括getXx
2016-10-18 11:54:30
3124
翻译 Java反射教程-全面分析
Java Reflection makes it possible to inspect classes, interfaces, fields and methods at runtime, without knowing the names of the classes, methods etc. at compile time. It is also possible to instanti
2016-01-28 11:14:23
685
转载 内存分析工具 MAT 的使用
1 内存泄漏的排查方法Dalvik Debug Monitor Server (DDMS) 是 ADT插件的一部分,其中有两项功能可用于内存检查 :· heap 查看堆的分配情况· allocation tracker跟踪内存分配情况DDMS 这两项功能有助于找到内存泄漏的操作行为。Eclipse Memory Analysis To
2015-11-18 15:33:18
621
原创 Java 反射实例
public class AppNameHelper { Constructor mAssetManageCntr = null; Constructor mRourcesCntr = null; Method mMethodAddAssertPath = null; Method mMethodSetConfiguration = null; priv
2015-10-26 21:16:18
704
原创 Android Studio使用Gradle构建错误-Failure initializing default system SSL context
Error:A problem occurred configuring project ':GimeMeFive'.> Could not resolve all dependencies for configuration ':GimeMeFive:_debugCompile'. > Could not resolve cn.hiroz:uninstallfeedback-lib:
2015-10-22 12:37:30
2113
原创 Android logcat详解
Android日志系统提供了记录和查看系统调试信息的功能。日志都是从各种软件和一些系统的缓冲区中记录下来的,缓冲区可以通过 logcat 命令来查看和使用. 一、使用logcat命令的目的: 1、你可以用 logcat 命令来查看系统日志缓冲区的内容: [adb] logcat [] ... [] ... 详细内容,请查看Li
2015-10-16 18:02:31
810
原创 Android使用UncaughtExceptionHandler捕获全局异常
Android系统的“程序异常退出”,给应用的用户体验造成不良影响。为了捕获应用运行时异常并给出友好提示,便可继承UncaughtExceptionHandler类来处理。通过Thread.setDefaultUncaughtExceptionHandler()方法将异常处理类设置到线程上即可。 1、异常处理类,代码如下:[java] view plain
2015-09-24 10:24:46
429
原创 UiAutoMator Helper自动运行测试用例
import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io
2015-09-22 18:19:15
1656
原创 Java执行命令行问题
String launchTime = ""; try { String logcatCommand = "adb shell logcat -v time -d ActivityManager:I *:S"; Process process = Runtime.getRuntime().exec(logcatCommand); BufferedReader buff
2015-09-17 20:56:10
680
原创 achartengine绘制折线图
参考官网:https://code.google.com/p/achartengine/ public void test() { //准备数据集 XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset(); Random r = new Random(); for
2015-09-17 10:11:58
573
原创 Android报表绘制引擎对比
achartengineandroid-ski-reportichartjscharts4j参考:http://www.doc88.com/p-0807190907598.htmlACharEngine:因为其比较轻便简单,你也可以下载其源码,根据自己的 需要来改其源码从而实现自己所需要的功能.android-ski-report:这个也是免费的,这个没怎么去了解过
2015-09-16 16:46:46
1023
原创 Android自动化测试:Robotium在Android Studio中的使用
Android自动化测试:Robotium在Android Studio中的使用
2015-08-04 10:01:52
2956
原创 Android adb授权问题
最近用了两款Android机器,都无法跟电脑进行adb连接,十分郁闷。网上暂时也没有好的解决方案!环境:win8.1系统、大神F1极速版、adb最新版本现象:使用adb命令时,一直出现“error: device unauthorized. Please check the confirmation dialog on your device.”的错误,并且adb设备是离线的。原因:大
2015-05-08 17:34:12
4754
原创 -----------------------要毕业了--------------------------
-------------------------------------------要毕业了----------------------------------------------
2015-04-16 21:03:52
519
原创 Android系统MediaServer分析
1.MediaServer进程/*** Copyright 2008, The Android Open Source Project**** Licensed under the Apache License, Version 2.0 (the "License");** you may not use this file except in compliance with t
2014-12-22 16:58:22
5135
原创 LeetCode OJ - Text Justification
Text Justification Total Accepted: 9728 Total Submissions: 69240My SubmissionsGiven an array of words and a length L, format the text such that each line has exactly L characters and is
2014-10-09 14:55:53
598
原创 LeetCode OJ - Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be non
2014-10-09 14:49:33
634
原创 LeetCode OJ - Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is pretty straight forward. Could you devis
2014-09-15 13:13:17
551
原创 LeetCode OJ - Sqrt(x)
Implement int sqrt(int x).Compute and return the square root of x.分析:
2014-09-14 16:55:18
688
原创 LeetCode OJ - Unique Binary Search Trees II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return all 5 unique BST's shown below. 1 3
2014-09-14 13:47:17
693
原创 LeetCode OJ - Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened tree should look like: 1
2014-09-12 23:21:56
631
原创 LeetCode OJ - Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the f
2014-09-11 22:42:19
676
原创 LeetCode OJ - Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.分析:递归
2014-09-11 22:35:27
627
原创 LeetCode OJ - Word Ladder II
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one letter can be changed at a timeEach intermediate word must exi
2014-09-11 01:06:32
700
原创 LeetCode OJ - Word Ladder
Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach intermediate word m
2014-09-09 15:20:19
827
原创 LeetCode OJ - Restore IP Addresses
Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255.255.11.135", "255.255.111.35"]. (Order
2014-09-08 23:19:19
528
原创 LeetCode OJ - Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.分析:题目太经典了,
2014-09-08 22:12:38
558
原创 LeetCode OJ - Minimum Window Substring
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T = "ABC"Minimum window is "BAN
2014-09-08 16:59:03
644
原创 LeetCode OJ - Search in Rotated Sorted Array II
Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a function to determine if a given target is in the
2014-09-08 16:58:16
506
原创 LeetCode OJ - Sort Colors
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers
2014-09-07 17:20:56
579
原创 LeetCode OJ - Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:
2014-09-07 00:23:14
682
原创 《Linux驱动基础篇》- Linux内存管理深入篇
MMU内存管理单元,主要的作用是管理物理内存,当然涉及到虚拟内存和物理内存之间的转化。 内存管理的基本单元是物理页:尽管CPU最小的可寻址单元是字(通常是字节),但是MMU(管理内存并实现虚拟地址到物理地址的转化)通常是以也页单位进行处理的。同时从虚拟内存的角度来看,最小管理单位也是页。不同的体系架构支持的页大小是不一样的。大多数32位的体系架构支持4KB的页,而64位体系结
2014-09-04 00:02:17
577
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人