Github search repository api를 사용합니다.

Related tags

App GithubSearch
Overview

GithubSearch

✔️ Description

Github APIsearch repository api를 사용하였으며, 레포지토리를 검색할 수 있습니다.

star 개수를 기준으로 내림차순하여 인기있는 레포지토리부터 볼 수 있습니다.

📱 GIF

final

🛠 Used tech stack

Kotlin

MVVM

Rx

LiveData, Databinding, Retrofit2, OkHttp3

🪜 Project Structure with brief description

java.com.huijiny.githubsearch
 ┣ base
 ┃ ┣ BaseViewModel.kt
 ┃ ┗ BindingActivity.kt
 ┣ data
 ┃ ┣ model
 ┃ ┃ ┣ response
 ┃ ┃ ┃ ┣ OwnerResponse.kt
 ┃ ┃ ┃ ┣ RepositoriesResponse.kt
 ┃ ┃ ┃ ┗ RepositoryResponse.kt
 ┃ ┃ ┣ Owner.kt
 ┃ ┃ ┣ Repositories.kt
 ┃ ┃ ┣ Repository.kt
 ┃ ┃ ┗ RepositoryMapper.kt
 ┃ ┗ service
 ┃ ┃ ┗ SearchService.kt
 ┣ network
 ┃ ┣ GithubInjection.kt
 ┃ ┗ GithubRetrofit.kt
 ┣ repository
 ┃ ┗ SearchRepository.kt
 ┗ ui
 ┃ ┣ MainActivity.kt
 ┃ ┣ MainAdapter.kt
 ┃ ┣ MainViewModel.kt
 ┃ ┗ RecyclerBindingAdapter.kt

화면 하나의 규모가 작은 앱이라고 판단하여 fragment 대신 activity에 구현했습니다.

  • base

    • BaseViewModel
      • 뷰모델 베이스코드로 사용하며, compositeDisposiable에 disposable을 추가하고 clear합니다.
    • BindingActivity
      • DataBinding을 위한 Activity 베이스 코드입니다.
  • data

    • 데이터 모델과 mapper가 있습니다.
  • service

    • SearchService가 있으며, repository search api의 쿼리 종류 중, stardesc는 기본 파라메터로 구현해놨습니다.

      @GET("search/repositories")
      fun searchRepositories(
              @Query("q") query: String,
              @Query("sort") sort: String = "stars",
              @Query("order") order: String = "desc"
          ): Single<RepositoriesResponse>
  • network

    • GithubInjection
      • Retrofit빌더에 service를 create하여 반환받은 service를 provide하는 함수를 만들어놨습니다. repository 생성시에 service를 넘길 때 사용됩니다.
    • GithubRetrofit
      • OkHttp Interceptor로 네트워크 통신 시 Body를 로깅할 수 있습니다.
      • Service를 create하는 레트로핏 빌더 함수가 있습니다.
  • repository

    • viewmodel에서 repository를 실행하며 결과값을 Single로 받습니다.
  • ui

    • MainActivity와 MainAdapter, MainViewMode, RecyclerBindingAdapterl이 있습니다.

    • TextWatcher를 통해 글자 변화를 감지하며 debounce를 사용하여 일정시간 이후 검색쿼리를 viewmodel searchRepository 함수에 전달합니다.

    • api 결과 값에서 에러가 발생한다면 에러 코드 별 String 값 Id 데이터를 발행하며, MainActivity에서 observing하여 Toast로 메세지를 띄워줍니다.

    • MainActivity에서 recycler adapter에 데이터를 submit 하기 위해서 databinding을 사용했으며, RecyclerBindingAdapter를 사용해 adapter.submitList를 구현했습니다.

      <androidx.recyclerview.widget.RecyclerView
           android:id="@+id/recycler"
           ...
           app:submitList="@{viewmodel.repositories}" />
      
      
      
      
      
      
      
You might also like...
GitHub application fetches events, repositories and profile using GitHub APIs
GitHub application fetches events, repositories and profile using GitHub APIs

GitHub application using GitHub REST API Dagger MVVM architecture Mockk Jetpack Compose Kotlin Coroutines Application pages Attention If you want to u

Android app to search for Vaccines in India

Vaccine Finder Android app to search for Vaccines in India About Vaccine Finder Vaccine Finder is an Android app that checks for vaccines on your beha

Movie Search App - using Flow, Suspend Function, AAC ViewModel, Dagger Hilt and so on.
Movie Search App - using Flow, Suspend Function, AAC ViewModel, Dagger Hilt and so on.

Movie Search App - using Flow, Suspend Function, AAC ViewModel, Dagger Hilt and so on.

A manga reader app that can be used save / search / find and read latest manga / manhwa
A manga reader app that can be used save / search / find and read latest manga / manhwa

A manga reader app that can be used save / search / find and read latest manga / manhwa

A recipe app where user can search new recipes from an API
A recipe app where user can search new recipes from an API

Recipe -app This is a recipe app where user can search new recipes from an API, save them, create their own recipes and edit saved recipes. The app is

A Mobile application (Android), which facilitates the search for a medication, a pharmacy using geolocation.

#Pharmacom Pharmacom, est une application mobile natif - compatible avec mobile et tablette. Cette application a comme but principale de servir les ci

ComicsShow app: Display comics and search for any favourites one

ComicsShow app: Display comics and search for any favourites one. Technologies used: Koin: For injecting class and providing modules on runtime :). Vi

A simple app that shows the origin of the word we search
A simple app that shows the origin of the word we search

DictionaryApp A simple app that shows the origin of an english word Explore the docs » View Demo · Report Bug · Request Feature About The Project A si

An app which displays questions from Stack Exchange from it's api. Can search questions with tags as well. Uses MVVM architecture, dependency injection, coroutines, retrofit2 for network calls

Stack Exchange app What the app does? Shows a list of trending questions from stack exchange api Can search for the desires question. Can add tags to

Owner
huijiny
안녕하세요! 유희진입니다🧸
huijiny
Github Repository Search 어플리케이션 입니다.

github-search ?? Introduction Github Search API 를 사용해서 검색된 레포지토리 리스트를 보여줍니다. EditText에서 텍스트를 입력하면 검색 API를 호출하고, debounce를 사용해서 호출 간격을 조절했습니다. 각 레포지토리는

null 2 Jan 25, 2022
📺 A sample app to showcase Twyper with GitHub repo search API

swipe-search A sample app to showcase Twyper with GitHub repo search API ?? Demo Screen.Recording.2022-02-20.at.9.36.10.PM.mov ?? Tech Stack What How

theapache64 26 Jul 18, 2022
Github Repo Search Android App

Github Repo Search Android App Modular android app for searching trending Github repositories and the details of each repository.

mertselcukdemir 4 Mar 7, 2022
GithubUserApps is an application that can Search and Displaying the details of a User github

GithubUserApps is an application that can Search and Displaying the details of a User github. this apps is written in Kotlin with MVVM Architecture, RXJava3, Kotlin Coroutines, ROOM Database, Retrofit, and Data Store Preferences to saving the Dark/Light Theme Key-Value.

Joshua Jeremia 2 Aug 31, 2022
This projects implements Github User search with Android Pagination 3 Library

GithubUser Search An Android App that lists the github users sorted by most followers Resources GitHub API Building Clone the git repository Build ./g

Siyanatullah Khan 3 Oct 12, 2022
Android application for GitHub user search and view user details

GitHubApp Android application for GitHub user search and view user details Architecture UI observing the live data for the main list as received from

null 1 Mar 29, 2022
An app that allows you to search for Github profiles of users and their repositories [d.light Android Engineer Test], for the Android Engineer Role

An app that allows you to search for Github profiles of users and their repositories [d.light Android Engineer Test], for the Android Engineer Role

Joel Kanyi 9 Aug 26, 2022
Git history is an android application that simply tracks GitHub repository's issues.

Git History About Git history is an android application that simply tracks GitHub repository's issues. You can search for user and get all public repo

Aditya Sutar 0 Oct 17, 2021
Github-Api-Pagination-Example - Pagination 3 Example using Github Api

Github-Api-Pagination Pagination 3 Example using Github Api Tech Stack 100% Kotl

Anggoro Beno Lukito 2 Aug 22, 2022
GithubUsersGalleryApp - Github users app consumed Github API

GithubUsersApp ✨ Github users app consumed Github API ✨ Architecture Using Moder

Ali Azaz Alam 1 Feb 20, 2022