Skip to content

Commit 321ddfe

Browse files
committed
Initial commit
1 parent c731366 commit 321ddfe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+575
-301
lines changed

.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 28 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,32 @@
1-
# Weedmaps Android Code Challenge!
2-
3-
Hi there! Thank you for taking the time to conduct the Weedmaps Android code challenge. Please use this as a foundation to help you save time setting up your workspace; this project already contains some common dependencies and frameworks used in most Android projects.
4-
**If there are other dependencies and/or frameworks that you'd like to introduce/use please feel free to add them!**
5-
6-
# Dependencies
7-
- Kotlin Ext
8-
- Kotlin Coroutines
9-
- Mockito Kotlin
10-
- Koin
11-
- Retrofit
12-
- Moshi
13-
- Glide
14-
15-
## First Things First
16-
Register and get a token for the Yelp Fusion API [https://www.yelp.com/developers/documentation/v3/authentication](https://www.yelp.com/developers/documentation/v3)
1+
# Introduction
2+
Hi there! Thank you for taking the time to conduct the Weedmaps Android code challenge! A project template has been provided for you. Please focus on meeting the requirements, if you’d like to showcase additional skills you may feel free to do so although it is not expected. Feel free to take any creative liberties with interface design so long as they do not deviate from the requirements of the challenge.
3+
4+
## Expected Time Commitment
5+
We ask candidates to allocate **4-6 hours** for this assignment. Keep in mind this doesn’t have to be all in one sitting. You may spend no longer than **5 days** to complete this assignment, however if more time is needed please reach out!
6+
7+
# Overview
8+
Leveraging the [Yelp Fusion API](https://docs.developer.yelp.com/docs/fusion-intro), build an app that displays businesses based on the user’s input in the search field. Follow the [instructions here](https://docs.developer.yelp.com/docs/fusion-authentication) to obtain an API Key for the Yelp Fusion API (don’t be worried about hard-coding the key into your app for this assignment). You may use the [designs here](https://www.figma.com/file/vcfmVmKtPf4hPwIm12jfQ5/Android-Homework?type=design&node-id=2-9&mode=design&t=EXoeVDU6A6rwhxmO-0) as a guideline for your interface. For your UI, please utilize [Jetpack Compose](https://developer.android.com/jetpack/compose) if possible, and avoid using any 3rd party UI frameworks. If you aren’t familiar with Compose, feel free to write in Android XML instead. Do not feel obligated to utilize all the properties and stubs in the project template.
9+
10+
## Dependencies
11+
- [Kotlin Extensions](https://kotlinlang.org/docs/extensions.html)
12+
- [Kotlin Coroutines](https://kotlinlang.org/docs/coroutines-overview.html)
13+
- [MockK](https://notwoods.github.io/mockk-guidebook/docs/quick/android/) (Unit Testing)
14+
- [Koin](https://insert-koin.io/)
15+
- [Retrofit](https://square.github.io/retrofit/)
16+
- [GSON](https://github.com/google/gson)
17+
- [Jetpack Compose](https://developer.android.com/jetpack/compose)
18+
- [Coil for Compose](https://coil-kt.github.io/coil/compose/)
19+
**Note:** You are free to add any other dependencies and/or frameworks that you'd like but we may ask about why you chose to include them.
1720

1821
## Requirements
22+
Requirements will differ based off of the level you are applying for. Please consult with your recruiter if you need clarification on requirements.
23+
**Important:** The Yelp Fusion API has a **query-per-second limit of 5**, and limited to **500 API requests per 24 hours.** Keep this in mind when configuring your API requests, otherwise you’ll receive a 429 HTTP error code for some of your requests. If you’d like, show us how you’d mitigate the query-per-second issue in your approach.
1924

20-
1. You will be building a simple search expereince using the yelp API. [here](https://www.figma.com/file/vcfmVmKtPf4hPwIm12jfQ5/Android-Homework?node-id=2%3A9). The data will be coming from the Yelp api linked below. Your application should return businesses based on the user's input in the search field.
21-
22-
2. Each business you show in the list should include: **name of the business**, **an image of the business**, and **the top review of the business(reference [here](https://www.yelp.com/developers/documentation/v3/business_reviews) for how to get the business review)**.
23-
24-
### If you are apply for a senior role, you must also:
25-
26-
3. The list must endlessly scroll based on the API's paging functionality.
27-
4. Include Unit Tests for parts of your code with important functionality (no need to get 100% code coverage on the whole project).
28-
29-
30-
## If you are applying for a senior role, please do at least 2 of the following:
31-
1. Requesting the user's location and sending that up in the request
32-
2. Save the list of a user's recent searchers and display those to the user as autocomplete suggestions
33-
3. Provide integration tests that verify the behavior established above
34-
4. Provide caching of the api requests which is invalidated after 15 days
35-
36-
## FAQ:
37-
- What if a link is broken above? Please reach out and we'll get those fixed.
38-
- What if I have any questions? Pretend your PM is on vacation, please use your best judgement and be able to speak as to why you made certain decisions.
39-
- Can I modify the designs? Yes, within reason. Stay as true to them as you can, and be prepared to explain any changes you make
40-
- Can I use other/additional libraries that aren't listed? Yes, just be ready to talk about them
41-
42-
## Notes
43-
44-
- **Important:** The Fusion API has a **query-per-second limit of 5**. Keep this in mind when configuring your API requests, otherwise you’ll receive a 429 HTTP error code for some of your requests. It would be a good idea to throttle the speed of your subsequent network requests.
45-
46-
## Links
47-
48-
- [Yelp Fusion API Documentation](https://www.yelp.com/developers/documentation/v3)
49-
50-
## Project Submission Instructions
51-
52-
Please submit either of the following to the link from the email containing your coding HW:
53-
A) your completed .zip file
54-
B) the link to a public repo with your completed project
25+
## FAQ
26+
- What if a link is broken above? Please reach out and we'll get those fixed.
27+
- What if I have any questions? Pretend your product manager is on vacation, please use your best judgment and be able to speak as to why you made certain decisions.
28+
- Can I modify the designs? Yes, **within reason.** Stay as true to them as you can, and be prepared to explain any changes you make.
5529

30+
# Submission
31+
Clone the git repository and complete using local IDE (Android Studio). Commits and created branches will show up on HackerRank web repository viewer. Please have the final submission merged into the master branch. Submit on HackerRank when the project is completed. If HackerRank isn't being used for this assessment, either ZIP the project file or provide a link to the public repository with your completed project.
32+
**Note:** Disregard the "Run Tests" button on the bottom right of the HackerRank project viewer.

app/build.gradle

Lines changed: 0 additions & 50 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.android)
4+
}
5+
6+
android {
7+
8+
namespace = libs.versions.applicationName.get()
9+
compileSdk = libs.versions.compileSdk.get().toInt()
10+
11+
defaultConfig {
12+
13+
applicationId = libs.versions.applicationName.get()
14+
minSdk = libs.versions.minSdk.get().toInt()
15+
targetSdk = libs.versions.targetSdk.get().toInt()
16+
versionCode = libs.versions.applicationVersion.get().toInt()
17+
versionName = libs.versions.applicationVersionName.get()
18+
19+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
20+
21+
vectorDrawables {
22+
useSupportLibrary = true
23+
}
24+
25+
}
26+
27+
buildTypes {
28+
release {
29+
isMinifyEnabled = false
30+
proguardFiles(
31+
getDefaultProguardFile("proguard-android-optimize.txt"),
32+
"proguard-rules.pro"
33+
)
34+
}
35+
}
36+
37+
compileOptions {
38+
sourceCompatibility = JavaVersion.VERSION_1_8
39+
targetCompatibility = JavaVersion.VERSION_1_8
40+
}
41+
42+
kotlinOptions {
43+
jvmTarget = "1.8"
44+
}
45+
46+
buildFeatures {
47+
compose = true
48+
}
49+
50+
composeOptions {
51+
kotlinCompilerExtensionVersion = libs.versions.kotlin.compiler.get()
52+
}
53+
54+
packaging {
55+
resources {
56+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
57+
}
58+
}
59+
60+
}
61+
62+
dependencies {
63+
64+
// LIBRARY DEPENDENCIES
65+
implementation(libs.coil.compose)
66+
implementation(libs.bundles.compose)
67+
implementation(platform(libs.compose.bom))
68+
implementation(libs.gson)
69+
implementation(libs.bundles.koin)
70+
implementation(libs.bundles.kotlin)
71+
implementation(libs.bundles.lifecycle)
72+
implementation(libs.bundles.retrofit)
73+
debugImplementation(libs.bundles.compose.debug)
74+
75+
// UNIT TEST DEPENDENCIES
76+
testImplementation(libs.bundles.unit.testing)
77+
testImplementation(libs.koin.test)
78+
79+
// INSTRUMENTATION TEST DEPENDENCIES
80+
androidTestImplementation(libs.bundles.instrumentation.testing)
81+
androidTestImplementation(platform(libs.compose.bom))
82+
androidTestImplementation(libs.compose.junit)
83+
84+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.ngmatt.weedmapsandroidcodechallenge
1+
package com.weedmaps.challenge
22

33
import androidx.test.platform.app.InstrumentationRegistry
44
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
1919
fun useAppContext() {
2020
// Context of the app under test.
2121
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22-
assertEquals("com.ngmatt.weedmapsandroidcodechallenge", appContext.packageName)
22+
assertEquals("com.weedmaps.challenge", appContext.packageName)
2323
}
2424
}

app/src/main/AndroidManifest.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.ngmatt.weedmapsandroidcodechallenge">
3+
xmlns:tools="http://schemas.android.com/tools">
34

45
<application
56
android:allowBackup="true"
7+
android:dataExtractionRules="@xml/data_extraction_rules"
8+
android:fullBackupContent="@xml/backup_rules"
69
android:icon="@mipmap/ic_launcher"
710
android:label="@string/app_name"
811
android:roundIcon="@mipmap/ic_launcher_round"
912
android:supportsRtl="true"
10-
android:theme="@style/AppTheme">
11-
<activity android:name=".HelloWorldActivity">
13+
android:theme="@style/Theme.ChallengeActivity"
14+
tools:targetApi="31">
15+
<activity
16+
android:name=".ChallengeActivity"
17+
android:exported="true"
18+
android:label="@string/app_name"
19+
android:theme="@style/Theme.ChallengeActivity">
1220
<intent-filter>
1321
<action android:name="android.intent.action.MAIN" />
22+
1423
<category android:name="android.intent.category.LAUNCHER" />
1524
</intent-filter>
1625
</activity>

app/src/main/java/com/ngmatt/weedmapsandroidcodechallenge/HelloWorldActivity.kt

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)