GithubHelp home page GithubHelp logo

yubyf / android-build-an-app-architecture-components-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlecodelabs/android-build-an-app-architecture-components

0.0 3.0 0.0 400 KB

License: Other

Java 100.00%

android-build-an-app-architecture-components-1's Introduction

Sunshine with Architecture Components

About

This app is for the Build an App with Architecture Components Codelab.

Starting Classes

Below is a description of the different packages and classes in the starting app code.

data package

Contains all classes related to local and network app data.

data.network package

All classes related to fetching data from the network.

  • The network fetching and parsing functions are all written for you.
  • You will not modify the NetworkUtils, OpenWeatherJsonParser and WeatherResponse classes.
  • WeatherNetworkDataSource manages everything to do with the network. It's a singleton. It contains:
    • scheduleRecurringFetchWeatherSync() - Makes a repeating JobService using FirebaseJobDispatcher. This repeating job will eventually sync weather information in the background.
    • startFetchWeatherService() - IntentService for doing an immediate fetch of weather data.
    • fetchWeather() - Actually gets weather forecast data. This method uses the JSON parsing classes and network classes to make the fetch. It currently doesn't do anything with the fetched weather data.
data.database package

All classes related to caching the data locally (it's pretty empty right now).

  • WeatherEntry - A simple Java object representing one day of weather.

ui package

All activities and adapters - anything to do with display.

ui.detail package
  • DetailActivity - Activity for a single day of forecast.
ui.list package
  • MainActivty - Activity for a list of WeatherEntry forecasts.
  • ForecastAdapter - RecyclerView.Adapter for displaying the list of WeatherEntry forecasts.

utilities package

  • You will not modify SunshineDateUtils or SunshineWeatherUtils.
  • SunshineDateUtils - Utility methods for normalizing dates across time zones; this helps us to "round" to the nearest date, so that when you store a date in the database, it always refers to that date at 12:00am, GMT.
  • SunshineWeatherUtils - Utility methods related to displaying the weather, such as picking the right image resource to show a cloudy sky or rain.

AppExectuors class

This class provides a global executor pool. You can learn more about thread pools here. In short, this class provides an easy and efficient way to run code off of the main thread.

License

All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav and *.ogg) are licensed under the CC-BY-NC license. All other files are licensed under the Apache 2 license. See the LICENSE file for details. Copyright 2017 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

android-build-an-app-architecture-components-1's People

Contributors

ceruleanotter avatar naokigoogle avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.