Skip to content

An example of a github users search app by implementing android jetpack

Notifications You must be signed in to change notification settings

elokanugrah/github-users-app

Repository files navigation

Github Users App

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.

Getting Started

  1. Copy url from download or clone button
  2. Open Android Studio -> New -> Project from Version Control
  3. Use Git as Version Control
  4. Paste the url in the URL field
  5. Clone and click yes when the dialog box appear
  6. Finally you can build the project

Github Accsess Token

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.

Project Functionality

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.

Tech Stack & Libraries

  • 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