随笔分类 -  Android进阶

摘要:Fragment详解 一、定义 因为Android设备尺寸大小不一 同一应用在不同尺寸上显示会有很大差异,fragment就是为了解决这个问题推出的。fragment可以看做是Activity界面的一部分,它有属于自己的生命周期和事件处理机制而且它可以动态的添加、替换、移除。 此处补充一个官方定义: 阅读全文
posted @ 2020-10-15 11:10 Robin132929 阅读(1221) 评论(0) 推荐(0) 编辑
摘要:Android Fragment 懒加载 一、为什么要进行懒加载 一般我们在使用add+show+hide去显示、隐藏fragment或者fragment嵌套使用、viewpager+fragment结合使用等场景下,如果不进行懒加载会导致多个fragment页面的生命周期被调用,每个页面都进行网络 阅读全文
posted @ 2020-10-15 11:08 Robin132929 阅读(3464) 评论(0) 推荐(1) 编辑
摘要:Application详解 一、简介 简介:Base class for maintaining global application state.The Application class, or your subclass of the Application class, is instant 阅读全文
posted @ 2020-10-13 11:55 Robin132929 阅读(767) 评论(0) 推荐(0) 编辑
摘要:Intent详解 一、什么是Intent 贴一个官方解释: An intent is an abstract description of an operation to be performed. It can be used with Context#startActivity(Intent)t 阅读全文
posted @ 2020-10-13 10:46 Robin132929 阅读(532) 评论(0) 推荐(0) 编辑
摘要:本地广播( LocalBroadcastManager)源码解析 一、什么是LocalBroadcastManager LocalBroadcastManager是注册和发送本地广播的helper。本地广播与全局广播有如下优势: 广播携带的数据不会离开app,所以无需担心数据泄露。 不允许其他app 阅读全文
posted @ 2020-10-12 19:29 Robin132929 阅读(511) 评论(0) 推荐(0) 编辑
摘要:发送广播(sendBroadcast)的过程源码分析 一、简介 这篇文章我们来分析sendBroadcast的过程。 二、源码分析 一般我们通过以下代码来发送一个广播 Intent intent = new Intent(XXX_ACTION); sendBroadcast(intent); sen 阅读全文
posted @ 2020-10-12 19:25 Robin132929 阅读(759) 评论(0) 推荐(0) 编辑
摘要:注册广播(registerReceiver)过程源码分析 一、简介 本文主要介绍动态注册广播过程。 二、源码分析 广播注册 IntentFilter filter = new IntentFilter(XXX_ACTION); registerReceiver(myReceiver, filter) 阅读全文
posted @ 2020-10-12 18:08 Robin132929 阅读(870) 评论(0) 推荐(0) 编辑
摘要:Broadcast知识详解 今天来看下Android四大组件之一的Broadcast。 一、什么是Broadcast Android apps can send or receive broadcast messages from the Android system and other Andro 阅读全文
posted @ 2020-10-12 18:06 Robin132929 阅读(927) 评论(0) 推荐(0) 编辑
摘要:ContentProvider的启动过程源代码分析 因为我们是通过ContentResolver来跟ContentProvider进行交互的,所以ContentProvider的启动的开始便从getContentResolver()开始分析。 1、获取ContentResolver并向Content 阅读全文
posted @ 2020-10-12 15:38 Robin132929 阅读(318) 评论(0) 推荐(0) 编辑
摘要:ContentProvider 一、简介 1、定义 它是Android标准的数据访问接口,用于应用间的数据共享,数据源可以是sql、xml、文件、Preferences、网络请求。 架构图 2、优点 安全:把数据共享给其他应用且不用担心敏感数据的泄漏 简单高效:底层使用匿名共享内存来完成数据的共享 阅读全文
posted @ 2020-10-12 14:29 Robin132929 阅读(845) 评论(0) 推荐(0) 编辑
摘要:Activity 一、什么是Activity 官方解释: The Activity class is a crucial component of an Android app, and the way activities are launched and put together is a fu 阅读全文
posted @ 2020-10-09 19:05 Robin132929 阅读(286) 评论(0) 推荐(0) 编辑
摘要:Android—Service 一、什么是Service Service(服务)是一个一种可以在后台执行长时间运行操作而没有用户界面的应用组件。服务可由其他应用组件启动(如Activity),服务一旦被启动将在后台一直运行,即使启动服务的组件(Activity)已销毁也不受影响。 此外,组件可以绑定 阅读全文
posted @ 2020-10-09 16:39 Robin132929 阅读(510) 评论(0) 推荐(0) 编辑
摘要:bindService流程源码分析 一、简介 bindService是应用用来与service进行绑定的。该方式启动的service系统认为只有在调用者的context存在时service才有必要运行,比如在activity中调用该方法且该activity处于stopped状态,那么其绑定的服务在a 阅读全文
posted @ 2020-10-09 16:35 Robin132929 阅读(566) 评论(0) 推荐(0) 编辑
摘要:JobIntentService源码解析 一、什么是JobIntentService JobIntentService用于执行加入到队列中的任务,在 android O或更高版本上运行时,工作将通过 jobscheduler 作为作业分派。 在旧版本上运行时,它将使用 Context.startSe 阅读全文
posted @ 2020-10-09 14:52 Robin132929 阅读(825) 评论(0) 推荐(0) 编辑
摘要:IntentService源码分析 一、什么是IntentService IntentService继承自Service并且本身就是一个抽象类 它可以用于在后台执行耗时的异步任务,当任务完成后会自动停止。 二、IntentService源码分析 先来看下IntentService的类结构 内部类Se 阅读全文
posted @ 2020-10-09 14:51 Robin132929 阅读(169) 评论(0) 推荐(0) 编辑
摘要:startService过程源码分析 一、简介 Service是Android四大组件之一,service有两种使用方式分别是startService和bindService,startService方式启动service之后我们无法控制service,即使调用service的组件死亡也不会导致启动 阅读全文
posted @ 2020-10-09 14:27 Robin132929 阅读(302) 评论(0) 推荐(0) 编辑
摘要:Android系统启动过程分析 一、Android平台架构 首先贴一张Android系统架构图方便理解整个Android架构,这可以让我们从整体上对整个启动流程有个大概认知。 可以看出整个架构由5部分构成,从下到上分别为: 1. Linux内核层 Android 的核心系统服务基于Linux 内核, 阅读全文
posted @ 2020-01-10 11:37 Robin132929 阅读(1748) 评论(0) 推荐(2) 编辑
摘要:Activity启动过程源码分析 本文来Activity的启动流程,一般我们都是通过startActivity或startActivityForResult来启动目标activity,那么我们就由此出发探究系统是如何实现目标activity的启动的。 一般我们都是通过上面两个函数来启动目标activ 阅读全文
posted @ 2020-01-08 14:42 Robin132929 阅读(1457) 评论(0) 推荐(0) 编辑
摘要:Activity知识点详解 一、什么是Activity 官方解释: The Activity class is a crucial component of an Android app, and the way activities are launched and put together is 阅读全文
posted @ 2019-12-22 21:35 Robin132929 阅读(867) 评论(0) 推荐(1) 编辑
摘要:Intent知识详解 一、什么是Intent 贴一个官方解释: An intent is an abstract description of an operation to be performed. It can be used with "Context startActivity(Inten 阅读全文
posted @ 2019-12-20 11:29 Robin132929 阅读(1796) 评论(0) 推荐(0) 编辑