Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
113 changes: 113 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 11 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,21 @@
# Work sample - Application developer
# Weather Application - Android

## Assignment
## About
- Simple android to show weather for your current location.
- App is developed in kotlin, demonstrating the use of RxJava2, Retrofit, Dagger2 and implementing MVVM with LiveData.

- Build an awesome weather app that shows the weather at your current location.
- Code it for the platform (Android, iOS, web) you applied for or the one you prefer.

## Minimum requirements
- Show the weather for your current location
- Use data from provided API (see API DOCS)
- Good usability
- Be visually appealing and follow platform conventions
- Budget: 8-12 hours

## Assets
You can find some icon assets at [https://github.com/erikflowers/weather-icons](https://github.com/erikflowers/weather-icons) that you can use if you please. You are more than welcome to use other assets that you feel are better fitted for your solution. We do not expect you to be a designer, but since application development on Daresay most often includes visual interfaces we do expect you to to be well aware of your platforms design guidelines and conventions.

## Expectations
###### User experience
The feature of the app is simple but we expect you to deliver a solution with a high user experience. Imagine this application is to be used by real user with real needs. Maybe your application won’t be as feature-full as many other applications on the market, but at least make it interesting, fun and intuitive to use. Of course you are allowed to extend your applications functionality. We appreciate solutions that exceed our expectations.

###### Code
We expect that the code is of high quality and under source control. Expect the solution to be continuously worked on by other developers and should therefore be easy to understand, adjust and extend. True beauty starts on the inside!

## Delivery
Fork the repository, code in your fork and make a pull request when done. Also send us an e-mail to let us know when you are done!

### Good luck!

---


# API DOCS
## General flow of data
- Check if the current location is set for the app, if not set then retrieve lat-long of the user location.
- If the location is set, show the weather for the current location.
- Show weather forecast for the current day and forecast the entire week.
- Show weather details for the selected day of the week.

## Base url
http://worksample-api.herokuapp.com


http://worksample-api.herokuapp.com is a simple wrapper of some of the endpoints provided on http://openweathermap.org/.

## Available Endpoints and Documentation
- http://worksample-api.herokuapp.com/weather [documentation](http://openweathermap.org/current)
- http://worksample-api.herokuapp.com/forecast [documentation](http://openweathermap.org/forecast5)
- http://worksample-api.herokuapp.com/forecast/daily [documentation](http://openweathermap.org/forecast16)

We always respond in JSON and metrics.
We also don’t support these features of the OpenWeatherMap API:

- Bulk downloading
- Search Accuracy (like/accuracy)
- Limitation of result
- Units format
- Multilingual support
- Callback functions for javascript.

## You can use these parameters
- It is a simple wrapper of some of the endpoints provided on http://openweathermap.org/.

#### API key (mandatory)
The API-key is required for all API calls. It should have been sent to you together with the instructions asking you to do the work sample.

#### By city name:
City name and country code divided by comma, use ISO 3166 country codes.

`?q={city name},{country code}`

`?q={city name}`
#### By city id:
List of city ID:s can be downloaded [here](http://bulk.openweathermap.org/sample/)

`?id={id}`
#### By geographic coordinates:
Coordinates of the location of your interest

`?lat={lat}&lon={lon}`
#### By Zip Code
`?zip={zip code},{country code}`
The API-key is required for all API calls.

##An example request:

[http://worksample-api.herokuapp.com/weather?q=Stockholm,SE&key={API_KEY}](http://worksample-api.herokuapp.com/weather?q=Stockholm,SE&key={API_KEY})
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
117 changes: 117 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

android {
// uses the variables like compile_sdk_version to keep the dependencies same throughout the application
compileSdkVersion rootProject.compile_sdk_version
buildToolsVersion rootProject.build_tool_version

defaultConfig {
applicationId "com.sneha.weatherapp"
minSdkVersion rootProject.ext.min_sdk_version
targetSdkVersion rootProject.ext.target_sdk_version
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

buildTypes {
debug {
buildConfigField("String", "BASE_URL", "\"https://worksample-api.herokuapp.com/\"")
buildConfigField("String", "API_KEY", "\"<YOUR_API_KEY_HERE>\"")
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// buildConfigField("String", "BASE_URL", "\"https://worksample-api.herokuapp.com/\"")
// buildConfigField("String", "API_KEY", "\"HBNA19QVVAPP\"")
}
}
}

dependencies {
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

//JARs
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Android Support Library
implementation "androidx.appcompat:appcompat:$app_compat_version"

// Constraint Layout
implementation "androidx.constraintlayout:constraintlayout:$constraint_version"

// Material Design
implementation "com.google.android.material:material:$support_library_version"

// RecyclerView
implementation 'androidx.recyclerview:recyclerview:1.1.0'

// CardView
implementation "androidx.cardview:cardview:$support_library_version"

// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"

// Lifecycle Annotations
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
kapt "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"

// Multidex
implementation "androidx.multidex:multidex:2.0.1"

// Dagger
implementation "com.google.dagger:dagger:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"

// Database
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-rxjava2:$room_version"

// Networking
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
implementation "com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0"

// Reactive
implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxjava_version"
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rxandroid_version"

// logger
implementation "com.jakewharton.timber:timber:$timber_version"

// Parser
implementation "com.google.code.gson:gson:$gson_version"

//Gps
implementation 'com.google.android.gms:play-services-location:17.0.0'

// Local Unit tests
testImplementation "junit:junit:$junit_version"
testImplementation "org.mockito:mockito-core:$mockito_version"
kaptTest "com.google.dagger:dagger-compiler:$dagger_version"
testImplementation "android.arch.core:core-testing:$core_testing_version"
testImplementation "org.hamcrest:hamcrest-library:$hamcrest_version"

// UI Testing
androidTestImplementation "androidx.test:runner:$test_runner_version"
androidTestImplementation "androidx.test.ext:junit:$test_ext_runner_version"
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
androidTestImplementation "androidx.test.espresso:espresso-intents:$espresso_version"
androidTestImplementation "org.mockito:mockito-core:$mockito_version"
kaptAndroidTest "com.google.dagger:dagger-compiler:$dagger_version"

implementation "androidx.swiperefreshlayout:swiperefreshlayout:$refresh_layout_version"
implementation "com.google.code.gson:gson:$gson_version"
}
Loading