{"id":16775211,"url":"https://github.com/arunkumar9t2/flickr-sample","last_synced_at":"2025-07-03T23:35:46.796Z","repository":{"id":102599930,"uuid":"179923971","full_name":"arunkumar9t2/flickr-sample","owner":"arunkumar9t2","description":"Sample flickr gallery app with minimal dependencies and RxJava","archived":false,"fork":false,"pushed_at":"2019-04-07T06:34:45.000Z","size":7038,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T17:46:12.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arunkumar9t2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-07T05:53:40.000Z","updated_at":"2023-09-08T17:52:27.000Z","dependencies_parsed_at":"2023-06-30T01:31:37.035Z","dependency_job_id":null,"html_url":"https://github.com/arunkumar9t2/flickr-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arunkumar9t2/flickr-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arunkumar9t2%2Fflickr-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arunkumar9t2%2Fflickr-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arunkumar9t2%2Fflickr-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arunkumar9t2%2Fflickr-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arunkumar9t2","download_url":"https://codeload.github.com/arunkumar9t2/flickr-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arunkumar9t2%2Fflickr-sample/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261630677,"owners_count":23187222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T06:51:22.784Z","updated_at":"2025-06-24T07:38:00.805Z","avatar_url":"https://github.com/arunkumar9t2.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nSimple image search app using the Flickr Image Search API. \n\n**Features**:\n - Endless scrolling of search results\n - 3 column grid view of images\n - Auto search as you type\n\n## Demo\n![enter image description here](https://github.com/arunkumar9t2/flickr-sample/raw/master/art/FlickrAppDemo.gif)\n\n# Overview\n\n\n - **RxJava** - Used RxJava for easier concurrency and thread management. \n\tExample:\n\t - Searching: Ability to search as you type by debouncing keystrokes to avoid unnecessary requests\n\t - Cancel existing network requests (both query and paging) when search query changes using `switchMap` operator.\n\t - Manage a bound thread pool of size 6 to fetch and decode images concurrently.\n - **OkHttp** - Used for easier networking to fetch `json` and `input stream` for `Bitmap`s.\n\n## Architecture\nMVP with Repository to avoid logical code in `Activity` and separate data related code. Loose coupling by making code dependent on interfaces rather than implementations eg: `ImageCache`, `ImagesDataSource`, `ImageLoader`. Explicit dependency on Flickr is avoided and is accessed through contracts.\n\n - `data` - `ImagesDataSource` is a contract for a source that provides paged searching. `FlickrImagesDataSource` is an implementation backed by `Flickr API`. Also includes data classes for parsing `json` response.\n - `DepedencyInjector` - Utility class to manage dependencies throughout the app. Responsible for managing and providing dependencies when requested. Eg: `DependencyInjector.provideHomePresenter`.\n - `Image Loading` - `ImageLoader` and `ImageCache` are contracts for a system that loads images efficiently by reducing sample size, perform concurrent requests and caching.\n \n\t- `DefaultImageLoader` - Loader backed by Rx to handle multiple requests and decode images.\n\t- `MemoryImageCache` - Lru based memory cache to hold few `Bitmap`s in memory.\n - `SchedulerProvider` - Contract to provide various type of `Schedulers` for concurrency. Can be replaced during testing via DI.\n - `Home` - Home feature package that contains, presenter for communicating with data layer, adapter for rendering grid and `HomeActivity`\n - `Test` - Presenter test for search term achieved by injecting `MockImagesDataSource` and testing paging and searches.\n\n# Possible improvements\n\n- `ImageLoading`\n\t\t- While current implementation automatically uses `ImageViews` dimensions to downsize source image, there are other cases that could handled for better performance. Currently the load request is not cancelled when the `ImageView` is detached from window and relies on `RecyclerView.Adapter.onViewRecycled` to cancel the request, this could be changed to use `View.onAttachStateListener` to free one of the threads thereby improving load performance during scrolling.\n\t\t- Could use battle tested solutions like `Glide` or `Picasso`.\n- `Paging`\n\t\t- By using [PagedList](https://developer.android.com/reference/android/arch/paging/PagedList) and [PageKeyedDataSource](https://developer.android.com/reference/android/arch/paging/PageKeyedDataSource) to simplify scroll listening, load more and concentrate on API implementations\n- `Dagger 2` \n\t\t- Use Dagger 2 instead of custom `DependencyInjector` to achieve compilation safety and scaling.\n- `State Restoration`\n\t\t- Currently only the search term is restored upon a config change, this could be changed to use `ViewModel` pattern to cache the image list as well to avoid additional network calls.\n- `Better Error handling` \n\t\t- When a paged list fails to load, possibly a retry button could be used to restart failed requests.\n- `Test` - Additional integration tests to avoid breakage due to 3rd parties.\n- `LocalDataSource` - Implement a local data source for provide search results stored on disk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farunkumar9t2%2Fflickr-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farunkumar9t2%2Fflickr-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farunkumar9t2%2Fflickr-sample/lists"}