GiphyLoaderAndroid - an Android app in Jetpack Compose using Hilt, Ktor, Coil, Paging3 and Coroutines
This app implements Giphy API search endpoint.
This app has one screen which contains a search field and a staggered grid of GIFs. Scrolling down will trigger paging. The app has basic error handling and shows a loading icon while fetching GIFs.
The Github repository for this project contains a file called app-debug.apk
which can be moved to an Android mobile phone and installed from storage. This method yields the best app performance.
To build the project from AS, a file by the name ApiKey.kt
needs to be created in the /app/src/main/java/com/example/giphyloader/common
path. This file needs to contain a valid Giphy API key Here is what the file should look like:
package com.example.giphyloader.common
const val API_KEY = "[VALID GIPHY API KEY]"
While building on an emulator is possible and the app will be usable, for better performance, the app should be built on a physical Android mobile phone.
An initial design was created for this app in Figma. To view this and screenshots from the app, open this link.
Android developer documentation
https://developer.android.com/
StackOverflow
Ktor setup
https://tahaben.com.ly/2023/02/making-api-request-using-ktor-client-in-android/
Ktor + Hilt
https://tahaben.com.ly/2023/02/how-to-use-hilt-for-dependency-injection-in-your-android-projects/
VM, UI, debounce
LaunchedEffect
https://betterprogramming.pub/jetpack-compose-side-effects-launchedeffect-with-example-99c2f51ff463
Response class
https://medium.com/codex/kotlin-sealed-classes-for-better-handling-of-api-response-6aa1fbd23c76
Pagination
https://proandroiddev.com/pagination-in-jetpack-compose-with-and-without-paging-3-e45473a352f4#3674