Android Architecture components--Project Combat

Source: Internet
Author: User

Reprint please indicate the source, thank you!

Last month Google Android Architecture Components 1.0 Stable release, pumping work Gap wrote a demo, for reference only

GitHub Address: Https://github.com/AllenWen/android-iWeather

1. Highlights

One is life cycle management---lifecycles, the reference of various types of components and periodic binding, so as to effectively avoid memory leaks;

The second is the Livedata, the protagonist in the data stream, acting similar to the RX's observer;

Third, the introduction of a new Database ORM framework---The bedroom, of course, life cycle security, modification immediately effective;

Four is a library called paging, used for paging processing, this project is useless.

2. Overview

Look at the figure, of course, is an MVVM framework, acitivity/fragment is view, ViewModel acts as a VM, a warehouse consisting of a local database and network data (Repository) is the model,

Acitivity/fragment can implement Lifecycleowner interface, register lifecycleobserver for life cycle management,

Livedata acts as data in a one-way data stream and binds to the life cycle

3. Project

With a free weather API that knows the weather and writes a minimalist-style weather app, it doesn't map, see GitHub for details

Android Architecture components--Project Combat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.