- 博客(241)
- 资源 (4)
- 收藏
- 关注
转载 High-Order_functions_and_lambdas
Higher-Order Functions and Lambdas1Higher-Order FunctionsA higher-order function is a function that takes functions as parameters, or returns a function.fun <T, R> Collection<T>.fold( ...
2020-01-06 14:26:58
392
转载 Services overview
1 Services overviewA Service is an application component that can perform long-running operations in the background, and it doesn’t provide a user interface. Another application component can start a...
2019-10-21 22:25:03
395
原创 Vim搜索
1 显示、不显示行号:set nu:set nonu2 搜索高亮显示:set hlsearchhlsearch:highlight search3 同时搜索多个关键字多个关键字之间用“|”分隔方法一"/"后跟多个关键字,分隔关键字的“|”需转义,即“|”;/KeyWordsOne\|KeyWordsTwo\|KeyWordsThree ...方法二"/"后跟“\v”...
2019-10-21 14:29:13
403
转载 Understand Tasks and Back Stack--Defining launch modes
Defining launch modesUnderstand Tasks and Back Stack--Defining launch modes1、Using the manifest file"standard" (the default mode)"singleTop""singleTask""singleInstance"2、Using Intent flagsFLAG_ACTIVIT...
2019-10-13 16:55:01
290
转载 Java PECS
extendsThe wildcard declaration ofList<? extends Number> foo3means that any of these are legal assignments:List<? extends Number> foo3 = new ArrayList<Number>(); // Number "e...
2019-06-25 16:23:13
246
原创 IntentFilter匹配规则
1、Intent typesIntent有两种类型,显式Intent和隐式Intent。使用显式Intent启动的目标组件特别明确,而隐式Intent则需要能够匹配组件在AndroidManifest.xml中声明的<intent-filter>信息。2、Intent Filter当通过隐式Intent启动Activity时,该Intent需要同时匹配Activity在...
2018-12-01 21:22:39
579
原创 Android 8.0 Oreo 形为变更之 Notification Channels
最近(2018年11月15日)在上传App升级包至Google Play时,遇到了如下问题:即:当前App的Target API Level 为25(Android 7.1.1 Nougat),要求将App的Target API Level提升到26(Android 8.0 Oreo)或以上。查阅资料发现,Google开发者在持续提高 Android 应用的安全性与性能一文中提到:...
2018-11-17 16:50:26
827
转载 持续提高 Android 应用的安全性与性能
为了提升App的安全性及性能,确保每个用户都能够获取最佳体验,Google对Android应用开发者提出了一些变更:今天,我们想要和各位 Android 开发者简单说明一下三项变更,它们背后的原因,以及它们如何让 Android 设备运行得更加安全和流畅。 从 2018 下半年开始,Google Play 要求新 App 和 App 更新包将目标 SDK 版本(Target SDK Ve...
2018-11-17 14:56:20
533
原创 Android Studio: Debug Android SDK Source Code
1>查看当前设备的API Level如图,设备Android版本为8.0.0。2>使用SDK Manager下载对应的Source Code注意: a、勾选右下角的“Show Package Details” b、勾选Android 8.0.0(Oreo)下面的“Sources for Android 26”,点击"OK",即可下载该版...
2018-11-13 15:25:09
925
原创 Android Bundle--ArrayMap详解
Android 四大组件:Activity、Service、ContentProvider、Broadcast Receiver。在Android App开发中,跟UI相关使用的最多的莫过于Activity了。一个Activity 启动另一个Activity时,可以使用Intent,其包含了一组方法方便携带一些参数:1、MainActivity中包含一个按钮,点击打开DetailAct...
2018-11-03 18:47:38
1136
原创 Android Platform Codenames, Versions, API Levels, and NDK Releases
The code names match the following version numbers, along with API levels and NDK releases provided for convenience:https://source.android.com/setup/start/build-numbers
2018-06-28 16:04:05
241
转载 ScrollView’s handy trick--android:fillViewport="true"
ScrollView is one of Android’s most commonly used widget and is also one of the easiest to use. When something is too big to fit on screen, drop it inside a ScrollView and you’re done. You can’t even ...
2018-03-26 17:25:34
278
转载 OK Http-Interceptors
Interceptors are a powerful mechanism that can monitor, rewrite, and retry calls. Here's a simple interceptor that logs the outgoing request and the incoming response.class LoggingInterceptor im
2018-02-06 11:24:42
540
转载 Android Architecture Components--Saving UI States
In cases where the UI data to preserve is simple and lightweight, you might use onSaveInstanceState()alone to preserve your state data. In cases where you have complex data that you want to preserve
2018-02-05 16:29:00
313
转载 Android内存泄漏总结
Android 内存泄漏总结箫鉴哥 2016-01-19 13:44:26 浏览42979 评论10android 性能优化 阿里技术协会 内存管理 内存泄漏摘要: Android 内存泄漏总结 内存管理的目的就是让我们在开发中怎么有效的避免我们的应用出现内存泄漏的问题。内存泄漏大家都不陌生了,简单粗俗的讲,就是该被释放的对象没有释放,一直被某个或某些实例所持有却不再被
2017-12-29 16:14:26
485
转载 单例-双重检查锁定与延迟初始化
在java程序中,有时候可能需要推迟一些高开销的对象初始化操作,并且只有在使用这些对象时才进行初始化。此时程序员可能会采用延迟初始化。但要正确实现线程安全的延迟初始化需要一些技巧,否则很容易出现问题。比如,下面是非线程安全的延迟初始化对象的示例代码:public class UnsafeLazyInitialization {private static Instance instance;
2017-12-22 13:58:21
389
原创 OkHttp Source Code Analyse (Part one)
OkHttp An HTTP & HTTP/2 client for Android and Java applicationsFrom:http://square.github.io/okhttp/Example:OkHttpClient client = new OkHttpClient(); Request request =
2017-12-07 11:40:36
315
转载 Method References
From:https://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.htmlKinds of Method ReferencesThere are four kinds of method references:KindExampleReference to a static m
2017-11-14 15:43:39
294
转载 Syntax of Lambda Expressions
A lambda expression consists of the following:A comma-separated list of formal parameters enclosed in parentheses. The CheckPerson.test method contains one parameter, p, which represents an in
2017-11-14 10:43:09
284
转载 Android Studio--Read garbage collection messages
Sometimes when a garbage collection event occurs, they're printed to logcat.For more detail about your app's memory, use the Memory Profiler.Dalvik log messagesIn Dalvik (but not ART), every
2017-11-03 17:55:42
373
转载 TCP Connection Establishment Process: The "Three-Way Handshake"
Normal Connection Establishment: The "Three Way Handshake"To establish a connection, each device must send a SYN and receive an ACK for it from the other device. Thus, conceptually, we need to have
2017-10-20 10:54:22
745
转载 Java 对象初始化过程
例子里总共测试了静态代码块,普通代码块,静态成员变量,普通成员 变量,构造器。分别在基类和派生类里各有一套。public class ClassLog { private static final String TAG = "ClassLog"; public static String baseFieldInit() { Loger.i(TAG, "base
2017-10-01 14:48:02
398
4
转载 display two or more logcat filters at the same time in Android Studio
up votedown votefavoriteI have declared two LOG.i such as followings in my code:Log.i("pen", pen.toString);Log.i("book", book.toString);Then I added these two filters to
2017-09-25 17:30:49
311
转载 Android Studio / Intellij Tip of the Day
Android Studio / Intellij Tip of the Day: tools:attributeIf you have ever entered some testing text in a TextView to see how it looks in the previewer, then this is for you.For any attribute in th
2017-08-24 14:06:28
1358
转载 Android Studio Tip of the Day--Breakpoints
Android Studio Tip of the Day--Breakpoints
2017-08-23 17:50:59
589
转载 Showing a Dialog Fullscreen or as an Embedded Fragment
You might have a UI design in which you want a piece of the UI to appear as a dialog in some situations, but as a full screen or embedded fragment in others (perhaps depending on whether the device is
2017-07-24 19:52:29
478
原创 从fragment开始向上查找实现了某个接口的parent Fragment 或者 Activity
//从fragment开始向上查找实现了接口listenerClass的fragment或activity public T findInterfaceByClass(Fragment fragment, Class listenerClass) { if (listenerClass != null) { if (fragment != null
2017-07-24 10:25:50
537
原创 Fragment 与DialogFragment 相互之间传递数据
场景:步骤在FragmentA 中触发显示DialogFragmentB,并传递参数数据mA2B给DialogFragmentB,在DialogFragmentB获取该参数--mA2B。步骤在DialogFragmentB中对传递的参数mA2B进行一些处理得到结果mB2A,最后点击“完成”,需要将mB2A回传给FragmentA中。步骤中的数据传递如何完成呢?步骤数据传递方
2017-06-20 11:28:42
8067
2
转载 你所不知道的Android Studio调试技巧
首先,来看看Android studio中为我们提供的调试面板(标准情况下):这里写图片描述点击右上角Restore ‘Threads’View可先展示目前相关的线程信息:这里写图片描述android studio大体为我们提供了7个功能区:单步调试区断点管理区求值表达式线程帧栈区对象变量区变量观察区下面我们分别对这七
2017-05-26 16:37:58
672
原创 Android 如何快速定位当前页面是哪个Activity or Fragment
在日常需求开发中,经常碰到不太熟悉的模块,如何快速定位相应页面对应的Activity/Fragment ? (1)查看当前Activity :adb shell "dumpsys window w | grep name="(2)查看当前栈顶的Activity :adb shell dumpsys activity | grep "mFocusedActivity"(3)查看当前...
2017-05-11 11:21:15
12876
2
转载 Helper class for creating pools of objects.
/* * Copyright (C) 2013 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 the License. * Yo
2017-05-04 11:34:31
354
转载 Positions in RecyclerView
Positions in RecyclerView:RecyclerView introduces an additional level of abstraction between the RecyclerView.Adapter and RecyclerView.LayoutManager to be able to detect data set changes in batc
2017-03-30 16:24:13
303
转载 Set "gravity" attribute to a RelativeLayout not working
How gravity affects the subviews is shown in the image below.I resized the widths of all the subviews so that what is happening is more clear. Note that the way RelativeLayout handle
2017-03-07 18:28:39
377
转载 Notifications --- Preserving Navigation when Starting an Activity
When you start an Activity from a notification, you must preserve the user's expected navigation experience. Clicking Back should take the user back through the application's normal work flow to the
2017-01-20 10:58:27
378
转载 Using the RecyclerView
OverviewThe RecyclerView is a new ViewGroup that is prepared to render any adapter-based view in a similar way. It is supposed to be the successor of [[ListView|Using-an-ArrayAdapter-with-ListView]] an
2017-01-17 16:40:17
1386
转载 Size, Padding and Margins
The size of a view is expressed with a width and a height. A view actually possess two pairs of width and height values.The first pair is known as measured width and measured height. These dimen
2017-01-16 15:31:11
560
原创 Google Android 原生Rom 下载地址及刷机教程--Factory Images for Nexus and Pixel Devices
Google Android 原生Rom 下载地址及刷机教程详见链接:https://developers.google.com/android/images#hammerheadkrt16m
2017-01-13 17:48:48
83884
1
转载 Broadcasts -----Security considerations and best practices
Here are some security considerations and best practices for sending and receiving broadcasts:If you don't need to send broadcasts to components outside of your app, then send and receive local
2017-01-06 11:46:22
385
转载 Requesting Permissions at Run Time
Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app.This approach streamlines the app install process, since the user doe
2016-12-29 10:34:22
362
转载 Things That Cannot Change
Sometimes a developer will make a change to an application that has surprising results when installed as an update to a previous version — shortcuts break, widgets disappear, or it can’t even be insta
2016-12-26 13:21:21
272
Android图表--achartengine
2014-10-26
SmartUpload上传及下载
2014-09-12
JFreeChart使用相关
2014-09-11
DAO设计模式Demo
2014-09-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人