Kart is simple android application which uses Dummy JSON API to serve as simple demo e-commerce application that demonstrates different ways of communicating with the backend services. In its current implementation it uses Retrofit and Ktor client.
The main purpose of the project is to, as description mentions, demonstrate different ways to communicate with the backend services without going into too much detail. So you, as a developer, should only focus on couple of files within this project to get going with your own. It's not here to demonstrate how Jetpack Compose works, how use-cases are laid out; it's purely for simple Retrofit/Ktor client setup to get you going.
Clone the repository, and run the project, no additional setup is needed. Simple as that. Main branch uses Retrofit, but you can select which config you want to use by switching to different branch.
If you opt out for using this pretty standard networking library, you might want to explore following files:
- DummyApiService - which declares different API calls that you might want to use within your application. Not every Retrofit part is covered, so might want to extend that knowledge via its official documentation.
- ProductsModule - here we provide all things we need data related (from API calls, to use-cases). This is important since we inject DummyApiService into repository implementation.
- NetworkModule - here we provide retrofit instance along with some additional configuration.
If you opt out for using this newer, but equally powerful networking library, you might want to explore following files:
- ProductsRemoteDatasourceImpl - here we utilize ktor client to fetch body of our requests given the specific URL. Not every Ktor client part is covered, so might want to extend that knowledge via its official documentation.
- ProductsModule - here we provide all things we need data related (from API calls, to use-cases). This is important since we inject remote data service into repository implementation.
- NetworkModule - here we provide ktor instance along with some additional configuration.
If you want to contribute to this repository, you're always welcome!
If you need any help, feel free to contact me: kenan.karic@outlook.com.
