Skip to content

nuhkoca/pickyup-assessment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PickyUp

PickyUp

💥 This project is a hiring task by upday for Samsung.

Build Status

PickyUp is an image search app that uses Shutterstock API in the backend. Users can search any image with different type of settings. They can also add images to their favorite lists.

Please visit Shutterstock Developer Page to obtain your own Bearer Token.

Configuration

In order to run this project, you need to get your own token from Shutterstock

Then set your token in the gradle.properties file as follows:

BEARER_TOKEN = "your-bearer-token"

You also need create a Firebase Project and download google-services.json in order to use Firebase Admob. Please refer to the Firebase Console and Google Admob.

Features

  • Users can search any image with search bar.
  • Users can add images to their favorites list.
  • Users can remove any image from their favorites list.
  • Users can change search criteria by the Settings page.
  • Users can view original size of any image by the WebView page.
  • Users can generate relative labels from images.

Screenshots

Phone

Images Screen Favorites Screen Settings Screen WebView Screen Image Labeling

Tablet

Soon - Genymotion doesn't support screenshot for free licenses.

Description of the problems and solutions

  1. Bottom Navigation View was overlapping RecyclerView's items. That is why 56dp(Bottom Navigation View height) padding was used for the ViewPager which holds Fragments. Link to solution
  2. Snackbar was insisting to placed in front of the Bottom Navigation View and it was fixed using 56dp-~170px with drop shadow(Bottom Navigation View height) margin bottom. Link to solution
  3. App used to close when back pressed even if search bar is not empty. This is because Custom SearchView was created and query checking mechanism was implemented when back pressed. If search bar is not empty, in first backpresses, SearchView gets collapsed and cleaned then app is closed. Link to solution
  4. Query used to not preserve its state in case of screen rotation and users had to re-type their queries. Therefore saveInstanceState was implemented. Link to solution
  5. In very first run, app was crashing due to the fact that onSharedPreferenceChanged method was called even if values have their existing ones. A logic that controls first run was developed and the crash is avoided. Please note, this might be a temporary solution. Link to solution
  6. Images on WebView were too big and it was fixed by a couple of code block. Link to solution
  7. Sometimes accessing to resources in unit tests is too hard. In this case, Mockito jumps in! I was able to fix resource access by its @Mock annotation which imitates context and so on integrating when and thenReturn methods. Link to solution
  8. Accessing to static or final classes in unit test is kinda torture. Since I need to access to some of static and final classes to test RxJava, Observable and Observers, I had to use the power of PowerMock! Link to solution
  9. No more issue! :)

Reasoning technical choices

  1. PagingLibrary is used to have smoother scrolling and to avoid boilerplates such as using a CustomEndlessScroll class.
  2. Room Persistence Library is used to keep favorite items. It is a prominent component to store local data since it has been an important part of the Architecture Components.
  3. MVVM Pattern is implemented as the parent pattern of the application. MVVM provides;
  • ViewModels are simple classes that interacts with the logic/model layer and just exposes states/data and actually has no idea by whom or how that data will be consumed. Only View(Activity) holds the reference to ViewModel and not vice versa, this solves our tight coupling issue. A single view can hold reference to multiple ViewModels.
  • ViewModels are even more Unit Test friendly as they just expose the state and hence can be independently tested without requiring the need for testing how data will be consumed, In short there is no dependency of the View.
  1. Retrofit - RxJava couple is implemented since Retrofit is the best and light-weight HTTP library. It can also work great with RxJava's adapter.
  • Rx are a set of interfaces and methods which provide a way to developers to solve problems rapidly, simply to maintain, and easy to understand. RxJava provides just that, a set of tools to help you write clean and simpler code.
  1. Stetho is used to track network and database progresses over browser.
  2. Gson is chosen to serialize comfortably web-service outputs as it provides an opportunity to serialize nulls, though.
  3. Bottom Navigation View with ViewPager is implemented since the app has a small set of screen.
  4. Mockito is chosen for unit tests as it is recommended by the official document and it lets you write beautiful tests with a clean & simple API and allows to mock objects easily.
  5. PowerMock is chosen as it enables mocking of static methods, constructors, final classes and methods, private methods, removal of static initializers and more. It is also a good choice to test Observers, Observables and RxJava.

Trade-offs in case of additional time/My SWOT analysis

  1. I would implement offline data for the Images Screen in case of no internet instead of error.
  2. I would have more options in the Settings Screens instead of a limited one.
  3. I would create another screens for musics and videos with the power of YoutubePlayerAPI, too.
  4. I am very familiar with Travis CI but I cannot fix an issue if a project has secret keys. It fails constantly and I cannot go further. If I fix that issue I will be able to integrate a CI tool properly. This project is also connected to Travis but it fails :)

Link to other codes that I might be proud of

  1. Trippo - My Capstone Project as part of Google's Android Scholarship Program
  2. News App - My workout for the latest technologies
  3. XYZ Reader App - Google Project's 5th task
  4. Baking App - Google Project's 3rd task - ExoPlayer and Widgets are implemented
  5. My Workout about Firebase ML Kit in Kotlin language - I try staying update with the latest technologies so that developed that app which recognizes texts, faces and labels.

Link to my resume/portfolio

  1. My Personal Website
  2. My Linkedin - CV is acceessible
  3. My Google Dev Account
  4. My Certificate by Google and Udacity

Credits

License

App icon based on:

Icons made by Freepik from Flaticon is licensed by CC 3.0 BY

Some icons in the app based on:

Icons made by Freepik from Flaticon is licensed by CC 3.0 BY

MIT License

Copyright (c) 2018 Nuh Koca

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

A hiring process by upday for Samsung.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages