Skip to content

🌩Weather app on android using Java, Room, DataBinding, Dagger2, Retrofit 2 and MVVM

License

Notifications You must be signed in to change notification settings

denbondd/just-weather

Repository files navigation

🌩JustWeather

Table of content

Project description

It's a weather app writed in Java. App asking permission to location and use it to detect weather in your current city (if you granted permission). You can add cities manually by writing them. The whole code and design was made by me. Design you can see here in Figma. While making this project, I practiced my knowlege about databases, dependency injection, data binding, working with api and even some design skills.

Screenshots

Main screen:


Hourly and daily:


Custom NavDrawer:

Used technologies

Libraries:

List of APIs

Set up the project

The app won't compile without keys.c. For security concerns this file wasn't commit to repository. There are steps how to add this file below.

  • First of all, download or clone this repository
  • Open this project and wait for Gradle Sync to complete
  • Now you already have this app code, but for building it, you will need your own API-keys, because I can't push mine.
    To do this, please follow steps with screenshots below:

Android Studio:

  • Choose project view in left side pannel
  • Go to app/src/main/jni and create new file and name it keys.c
  • Copy paste to keys.c this code
#include <jni.h>

JNIEXPORT jstring JNICALL
Java_com_denbondd_justweather_services_Keys_getOWMkey(JNIEnv* env, jobject this) {
    return (*env)->NewStringUTF(env, "Your API-key for OpenWeatherMap");
}

If you don't know how to get your own API-key, here you go

  • Now build your project again, and if you paste working api key, you can use this app now.

Project structure

  • com.denbondd.justweather
    • dataflow - files for working with data (APIs)
    • db - files for working with RoomDB
    • di - files for dependency injection (Dagger2)
    • models - models needed for project
      • currentweatherowm - package with models for OpenWeatherMap CurrentWeather request
      • findowm - models for OpenWeatherMap FindCity request
      • onecallowm - models for OpenWeatherMap OneCall request
    • services - files for working with retrofit
    • ui - files used for user interface
      • activities - all activities of project
      • adapter - adapters and viewholders for recycler views
      • base - base ui components, that all other inherit
      • fragments - all fragments of project
    • util - different extensions

Download release apk

Release apk isn't available now, because I'm currently working on this app. Anyway, if you want to take a look on it, you can set up this project in Android Studio.

License

Copyright (c) 2020 Denis Bondarenko
MIT License

About

🌩Weather app on android using Java, Room, DataBinding, Dagger2, Retrofit 2 and MVVM

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages