Giter Club home page Giter Club logo

weatherapp's Introduction

WeatherApp

Weather app

  • App name is MyWeather

  • The whole app was developed using Android Studio 4.0

  • For searching by zip code, only zip code in US is supported. Seems like this API is only for US only.

  • Completed tasks from 1 to 4

  • Known Issues and possible solution: The city list JSON file is too big so on my emulator it takes around 7 seconds to load. The bottleneck is json deserialisation.
    ** Convert json to csv and only keep the id, name, country field. The file size will be much smaller and csv format is easier to parse than JSON format. ** Create a big java list with all the data already initialized. No need to read the json file and parse it.

  • code design:

    • A lot of code comes from https://github.com/android/architecture-components-samples/tree/master/GithubBrowserSample/
    • The csv will be loaded in a big list and then get sorted, then we can use binarysearch to find the matched city name by the first several characters. Such match operation will take much longer(around 40ms on my emulator) without using binarySearch and compare one by one in the list of more than 20,000 elements. It takes less than 1ms with binarySearch.*
    • Because the weather data comes from serveral APIs, MediatorLiveData is used to handle different sources of Live Data
    • The communication between WelcomeSearchFragment and RecentSearchFragment is not ideal. Currently from RecentSearchFragment we need to pass the query information back to WelcomeSearchFragment after recent search is clicked. With navigation component it will look better.
  • Choices of app libraries:

    • Android + kotlin + Androidx libraries
    • Network layer: Retrofit2 + OKHTTP + Moshi
    • Dependency injection: Koin
    • Gps location permission: easypermissions and play-services-location
    • Preference library 'com.scottyab:secure-preferences-lib:0.1.7' and implementation "com.f2prateek.rx.preferences2:rx-preferences:2.0.0" with the ability to save object in and get object from preferences.
    • Glide: to load weather icon file
    • Test libraries ** mockk: simple mock library ** mockwebserver: to test if the response can be parsed
  • Use of UI paradigms: MVVM + liveData + Data binding

weatherapp's People

Contributors

jamking avatar

Watchers

 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.