A simple Android mobile client that utilizes the Open Weather API as a source of weather forecasts.
This application is designed for Android 6.0 (Marshmallow) and newer versions.
This Android project is structured into the following modules:
- application - Generates the Aweather executable application.
- base:android - Implements utility features to enhance Android app development.
- base:language - Provides additional features for the Kotlin programming language.
- base:mvvm - Implements base classes for the MVVM architectural pattern and data binding.
- common:network - Contains shared networking features like URL interception, SSL handling, and more.
- common:persistence - Prepared for cache, storage, or database shared functionalities (currently empty).
- configuration - Parses
gradle.properties
and provides injectable configuration. - feature:location - Implements Open Weather - Geocoding integration layer.
- feature:recent - Implements simple search history functionality.
- feature:weather - Implements Open Weather - Current Weather integration layer.
- resources - Contains all reusable Android resources.
This application integrates with the Open Weather API. To function correctly, you need to generate an Open Weather API key for client authentication.
For more details, refer to the How to Start guide.
After generating the API key, navigate to the configuration
module and fill in
the gradle.properties
as demonstrated in gradle.properties.sample
.
Two build types are available:
debug
- Enables all development tools.release
- Disables all development tools.
Check the settings
directory for additional information, including:
distribute
- Contains Firebase App Distribution configuration.keystore
- Signing configuration details.
Before building for production:
- Change the build type to
release
.
The release
build type uses production configuration files that introduce
crucial changes:
- Define proper server connection details (URIs, etc.).
- Disable development tools.
- Configure network request log level.
You can configure several options in the configuration\gradle.properties
file:
Build type server-related options:
OpenWeatherApiUrl<build-type>
- Configure server URI.OpenWeatherApiId<build-type>
- Configure API key.
Note: Find the
gradle.properties.sample
file in application modules. For default values, copy and rename this file togradle.properties
.
After preparing the gradle.properties
file, sync your Gradle build to generate
the required BuildConfig
class with constant variables.