{"id":22797723,"url":"https://github.com/txtasad/piczillamvvm","last_synced_at":"2025-09-25T13:02:19.906Z","repository":{"id":158529264,"uuid":"264331963","full_name":"txtasad/PiczillaMVVM","owner":"txtasad","description":"A simple MVVM Android app to fetch images from Flickr Api and use LiveData and LRU cache without using any external library.","archived":false,"fork":false,"pushed_at":"2020-05-16T01:11:40.000Z","size":614,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T18:43:46.485Z","etag":null,"topics":["android","cache-storage","flickr-api","livedata-viewmodel","lru-cache","mvvm","mvvm-android","mvvm-sample","viewmodel"],"latest_commit_sha":null,"homepage":"","language":"Java","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/txtasad.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":"2020-05-16T01:04:22.000Z","updated_at":"2020-05-21T15:14:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"4aad6a6e-3afb-4d34-862f-c3f1b856f8cd","html_url":"https://github.com/txtasad/PiczillaMVVM","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/txtasad/PiczillaMVVM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txtasad%2FPiczillaMVVM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txtasad%2FPiczillaMVVM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txtasad%2FPiczillaMVVM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txtasad%2FPiczillaMVVM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/txtasad","download_url":"https://codeload.github.com/txtasad/PiczillaMVVM/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txtasad%2FPiczillaMVVM/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261823736,"owners_count":23215141,"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":["android","cache-storage","flickr-api","livedata-viewmodel","lru-cache","mvvm","mvvm-android","mvvm-sample","viewmodel"],"created_at":"2024-12-12T06:06:52.513Z","updated_at":"2025-09-25T13:02:19.501Z","avatar_url":"https://github.com/txtasad.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PiczillaMVVM\n\nA simple MVVM app to fetch images from Flickr Api and use LiveData and LRU cache without using any external library.\n\n## App Screens\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"/media/screen1.jpg\" width=\"250\" height=\"380\"\u003e\n    \u003cimg src=\"/media/screen2.jpg\" width=\"250\" height=\"380\"\u003e\n\u003c/p\u003e\n\n## App features\n* App shows random images from Flickr Api.\n* App has single full screen imageView to show images.\n* App has two buttons (next \u0026 previous) to navigate through images.\n* App uses cache strategy which means if an image has been fetched from url then it will be stored and served from cache.\n* App follows MVVM (Model View ViewModel) pattern.\n* No external library used for networking or image caching.\n* HttpUrlConnection with AsyncTask used for api calling and LRU cache used for effective loading and caching.\n* App supports landscape and portrait modes.\n\n## Api used\nBelow Flickr api is used to fetch images urls:\nhttps://api.flickr.com/services/rest/?method=\u003cphotos_method\u003e\u0026api_key=\u003capi_key\u003e\u0026format=json\u0026nojsoncallback=1\u0026safe_search=1\u0026tags=kitten\u0026per_page=10\u0026page=1\n\nwhere,  photos_method = flickr.photos.search\n        api_key = 3e7cc266ae2b0e0d78e279ce8e361736\nPlease register at https://www.flickr.com/services/api/ in case the given api key does not work.\n\nBuild image url from response object (farm, server, id, secret are present in response object)\n\nhttps://farm${this.farm}.staticflickr.com/${this.server}/${this.id}_${this.secret}_q.jpg\n\n## App structure\nApp follows below structure:\n* \u003cb\u003emodel\u003c/b\u003e\n    * Package contains POJO class for photo from api response.\n* \u003cb\u003eviewmodel\u003c/b\u003e\n    * \u003cb\u003eImagesViewModel: \u003c/b\u003e ViewModel containing logic to fetch image urls and check cache if any bitmap is available else download bitmap from url.\n* \u003cb\u003erepository\u003c/b\u003e\n    * Package contains class for fetching data repository of images list(JSON) and image i.e asyncTasks for fetching image urls and bitmaps.\n    * \u003cb\u003eDownloadImageTask: \u003c/b\u003e AsyncTask for downloading bitmap from given url. Also saves downloaded bitmap into cache.\n    * \u003cb\u003eFetchImageUrlsTask: \u003c/b\u003e AsyncTask for fetching images urls from Flickr api in chunks of 10 images per hit. Also parses json response.\n* \u003cb\u003eutils\u003c/b\u003e\n    * Package contains utility class and generic cache class.\n    * \u003cb\u003eImagesCache: \u003c/b\u003e Common LRU cache defined class. Any changes related to cache can be done here.\n    * \u003cb\u003eUtility: \u003c/b\u003e Utility class where HttpUrlConnection is defined for fetch images and download bitmaps.\n* \u003cb\u003eview\u003c/b\u003e\n    * Package contains UI classes which needs to be shown on app.\n    * \u003cb\u003eMainActivity: \u003c/b\u003e Single activity which contains a fragment.\n    * \u003cb\u003eMainFragment: \u003c/b\u003e Fragment class which contains ImageView and two buttons which will be shown to the user.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxtasad%2Fpiczillamvvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftxtasad%2Fpiczillamvvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxtasad%2Fpiczillamvvm/lists"}