An example of a github users search app by implementing Android Jetpack.
Github Users App is an app to search for github users by using Github REST API v3. This app was built by following best practices using Android Jetpack.
NOTE This app is in under development and made for experiments with the implementation of the modern tech stack in the future. That some changes (such as database schema modifications) are not backwards compatible and may cause the app to crash. In this case, please uninstall and reinstall the app.
- Copy url from download or clone button
- Open Android Studio -> New -> Project from Version Control
- Use Git as Version Control
- Paste the url in the URL field
- Clone and click yes when the dialog box appear
- Finally you can build the project
This app uses the Github REST API v3 to load users data into the app. To get an access token you can follow this instructions Creating Personal Access Token.
Once you have the token, add this line to the gradle.properties
file:
github_token=<your Github access token>
The app is still usable without an access token, but limited to 60 request per hour. See Rate limiting for details.
This app has 3 main screens namely : SearchUserFragment
, UserDetailFragment
and SavedUserFragment
.
-
SearchUserFragment
Allows you to search Github users. Initially only 20 users data will be displayed, but the next 20 data will be displayed by scrolling to the last line displayed on the screen. -
UserDetailFragment
Contains detailed information about the user such as username, name, bio, number of followers and following. This fragment has 2 child screens displaying the user's followers and following list which can be swiped right or left to navigate. In this fragment you can also save the user's data by clicking the love button on the bottom right -
SavedUserFragment
Contains the list of saved users. This list is stored in a local database. You can remove a saved user by swiping left, but you can still undo last removed user by clicking undo on the displayed snackbar.
- Minimum SDK level 22
- Kotlin based, using Coroutines for asynchronous.
- Architecture - A collection of libraries that help you design robust, testable, and
maintainable apps. Start with classes for managing your UI component lifecycle and handling data
persistence.
- Data Binding - Declaratively bind observable data to UI elements.
- Navigation - Handle everything needed for in-app navigation.
- Lifecycles - Build lifecycle-aware components that can adjust behavior based on the current lifecycle state of an activity or fragment.
- LiveData - Build data objects that notify views when the underlying database changes.
- Paging 3 (Alpha) - Load and display pages of data from a larger dataset over network.
- Room - Access your app's SQLite database with in-app objects and compile-time checks.
- ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
- Third party
- Retrofit2 & OkHttp3 for REST api communication
- Glide for image loading