Giter Site home page Giter Site logo

weather-app's Introduction

๐ŸŽˆ WeatherApp


I developed an app that shows the weather conditions during the day. After creating my own Api key on https://openweathermap.org/api, I added the daily and 8-hour weather forecast service to my project. When requesting these services,

it asks me for Api key,

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles(
                    getDefaultProguardFile("proguard-android-optimize.txt"),
                    "proguard-rules.pro"
            )
            buildTypes.each {
                it.buildConfigField 'String', 'API_KEY', '"0"'
                it.resValue 'string', 'API_KEY', '"0"'
            }
        }

    }
    override fun getOneDayWeather(lat: Double, lon: Double): Single<WeatherOneDayResponse> {
        return weatherApiService.getOneDayWeather(lat, lon, BuildConfig.API_KEY)
    }

    override fun getEightHourWeather(
        lat: Double,
        lon: Double
    ): Single<WeatherEightHourResponse> {
        return weatherApiService.getEightHourWeather(lat, lon, BuildConfig.API_KEY)
    }

latitude and longitude,

(WeatherFragment)

    override fun onLocationChanged(location: Location) {
        val geoCoder = Geocoder(requireContext(), Locale.getDefault())
        val address = geoCoder.getFromLocation(location.latitude, location.longitude, 1)

        val cityName = address?.get(0)?.adminArea
        binding.tvCity.text = cityName
        with(viewModel) {
            getWeatherOneDay(location.latitude, location.longitude)
            getEightHourWeather(location.latitude, location.longitude)
        }


    }

we asked the user for permission for the location and sent this information. In this way, I can show the user both the daily average and the weather conditions for certain hours during the day.

My Use Technologies

  1. MVVM,
  2. RxJava,
  3. Dagger Hilt,
  4. OkHttp and Retrofit,
  5. ssp and sdp,
  6. Leak Canary,
  7. Navigation Component

๐Ÿ“ท Pictures related to the application are located below

weather-app's People

Contributors

melissaozay avatar

Stargazers

 avatar  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.