ProAndroidDev

The latest posts from Android Professionals and Google Developer Experts.

Follow publication

Playing with…

Philippe BOISNEY
ProAndroidDev
Published in
5 min readFeb 13, 2019

1. How does this app work?

Normal use case (when everything goes well 👍)
Error use case (when everything goes to shit… 💩)

2. How this app is designed?

3. Show me the code!

3.1. Retrofit & Coroutines

Extract of UserService.kt
Extract from UserRepository.kt

3.2. Paging Library

Extract of UserDataSource.kt
Extract of UserDataSourceFactory.kt

3.3. ViewModel

Extract of UserViewModel.kt
Extract of BaseViewModel.kt

3.4 Koin

Extract of network_module.kt
Extract of view_model_module.kt

4. What about the test?

4.1 Unit Tests

Extract of UserRepositoryTest.kt

4.2 Instrumented Tests

Extract of SearchUserFragmentTest.kt

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in ProAndroidDev

The latest posts from Android Professionals and Google Developer Experts.

Responses (4)

Write a response