Coder Social home page Coder Social logo

rxweather's Introduction

#RxWeather

Architecting Android with RxJava

Sketch

这是一个简单的天气预报项目,目的是用来演示如何使用RxJava构造一个清晰的Android应用框架,并且加入了Rxbus,为了节约时间成本,界面并没有经过特别的设计,配色和控件的摆放也没有遵循Material Design设计规范,所以,它并不具备一款Android App所应该具备的素质,为此,我深感抱歉和遗憾。

我写了一篇文章,对这个项目做更深入的描述和解释:

Architecting Android with RxJava

Architecture

Model View Presenter:

MVP-Architecture

The Clean Architecture:

Clean-Architecture

Project Structure

  • presentation: Presenters、Views、Exceptions

  • usercase: UseCase

  • model: Service、Entities

  • common: Util、Constants、Event、RxBus、RxAndroid

Public API

使用百度地图获取位置信息。

使用和风天气公开接口,获取一周天气预报(暂不支持经纬度查询)。

使用Openweathermap提供的部分资料。

Usage

首先,因为目前这个版本不支持分页加载,所以,没有提供上拉加载功能。

其次,除了HeaderView天气是根据当前位置获取之外,其余天气均通过读取domain module下的city.txt文件来获取一周内天气。

通过以下步骤进行修改或增加:

  1. 下载Openweathermap提供的资料city.list.json.gz这个文件,找到需要的城市json字符串,复制到city.txtcities数组中。

  2. 在和风天气提供的国内城市ID列表中,找到对应城市的ID进行替换。

最后,搜索功能,输入城市地区的时候,请不要以“市”、“区”结尾,例如:用“北京”代替“北京市”,“朝阳”代替“朝阳区”。

Developed By

Follow me on Weibo Follow me on imooc Follow me on Jianshu Follow me on imooc

Acknowledgments

rxweather's People

Contributors

smartdengg avatar

Watchers

James Cloos avatar changjiashuai 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.