Giter Site home page Giter Site logo

weather-android's Introduction

What is this repository for?

  • This is weather android app which uses worldweatheronline.com as data provider
  • v1.0.0

How do I get set up?

  • ./gradlew clean build
  • and don't forget to setup your sdk.dir (via local.properties or direct specification)

Design concepts

The whole design of my app is based on Dependency Injections and EventBus concepts. I wanted to split all classes out from each other onto independent components.

Interaction with weather web-service is based on fetching forecast by latitude and longitude. I use shared preferences as a cache for forecast responses and update this cache in two cases:

  1. user refreshed the list manually by pull-to-refresh action on the list of data
  2. time of response is expired (it's 24 hours) and in the next scrolling action - application will try to fetch new data for this location

Dependencies

I used a lot of 3rd libraries and the main reason why I did it, just to speed up development process.

  • rxjava - don't like to hassle with AsyncTask
  • retrofit - quick bootstrap of any http webservice stub
  • ormlite - quick bootstrap for database
  • otto - eventbus
  • dagger2 - DI
  • com.etsy.android.grid - Staggered GridView for weather dashboard
  • timber - very customizable logger for android

Which design patterns I used

DI, EventBus, Observer, Builder

Applications consists of two screens:

  1. main screen with weather dashboard
  2. settings activity where the user can specify Temperature Units (Celcius or Fahrenheit)
  3. and Debug activity to show how to override eventbus

Small clarification: To refresh weathers list - just pull down (I used SwipeRefreshLayout from support library)

Unit-testing

To run & debug unit-tests in IDE you need to use Android Studio 1.4

weather-android's People

Contributors

neodp avatar dpolishuk avatar

Stargazers

 avatar Yurii Poudanien avatar  avatar Alex avatar Nick Titov avatar Maxim Garin avatar Yan avatar Vadim Kotov avatar Denis Nek avatar Sergey Vorobyev avatar  avatar Arsentiy Karpov avatar Egor Danilin avatar Alexander Blinov avatar Duan Wenbo avatar Sergey Eshin avatar Georgy avatar  avatar Pavel Konnikov avatar Dmitry Kalita avatar Alexey Agapitov avatar

Watchers

 avatar Pavel Potanin avatar

Forkers

vmaks

weather-android's Issues

BaseFragment injection

I want, for example, use Bus in every fragment, so I will move it to BaseFragment.
But if I am not explicitly doing ((BusSubcomponent) getComponent()).inject(this); in WeatherFragment (and/or removing inject from BusSubcomponent interface), I get an error.
What should I do to fix this? Sorry if the question is stupid, I am really new to DI.

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.