Thoughts on Content Handling in Android Application
Introduction
For content-oriented Android application, how and where to store the content to display is a issue every developer will be concerned with. The Android framework provided a comprehensive solution with ContentProvider
(and a lot more) which suits quite well with a SQLite database; but in a lot of other scenarios, the app only need to have some information cached, while the majority of content is directly retrieved from network, thus eliminating the need for a database (and a complicated content scheme).
But when we look into the core of this issue, we will soon find out that it is in fact a problem of whether to have a central storage, and how to notify different components about a change.
Android 开发入门指南
关于 C 语言的面试问题
使用 Gradle 发布项目至 Maven Central
使用 SWT 搭建跨平台桌面应用
LinearLayout 的拖放操作和动画
前言
Android 中ListView
的拖放操作和动画实现已经被这个 DevByte 和相关的样例说明,并且也有 ListViewAnimations 这样强大的开源库进行了集成。但是,一番 Google 后,我发现基于LinearLayout
的相关实现却不多。
然而,有时我们可能需要使用LinearLayout
替代ListView
来实现列表,例如不需要ListView
的视图回收机制(比如使用Fragment
作为列表项),或者我们需要把这个视图放在ScrollView
中。
在使用LinearLayout
实现拖放和动画时,实现代码相比于之前提到的ListView
实现也需要一些变动。因为我在网络上没有找到相应的资料,所以写下这篇文章来记录这个过程。