Code Monkey home page Code Monkey logo

android-engineer-codecheck's Introduction

haru-330

About Me

Hello! I'm Haru-330.

I am a developer living in Japan.

I am currently in my first year as a new graduate.

I was involved in development using Laravel as an intern at a company.

I also created UI and code CSS and HTML using Figma.

I have experience developing applications using Swift and Kotlin.

Connect with me

github x

GitHub Status

github Profile Summary Cards


github Profile Summary Cards


github stats

Top Langs

GitHub Trophies

trophy

android-engineer-codecheck's People

Contributors

blendthink avatar haru-330 avatar watanavex avatar

Watchers

 avatar

android-engineer-codecheck's Issues

提出準備

  • 適切にREADME.mdを書く
  • コードのwarningの修正 出来ず
  • ライブラリのチェック
  • Gitの設定チェック
  • 気になる点がコードにないかチェック
  • マージをmainにする
  • コメントを修正

クラッシュ

#3 のタスク

  • 検索ボックスに何も入れていない時、検索を実行すると、アプリがクラッシュするので、その解決
    #59 で解決

不必要なlateinit修飾子

#2 のタスク

  • 不必要なlateinit修飾子を削除する

  • SearchActivity.ktにlateinit修飾子があったので、修正する(以下の部分)

class SearchActivity : AppCompatActivity(R.layout.activity_search) {
    companion object {
        lateinit var lastSearchDate: Date
    }
}

公式ドキュメント
properties

UI をブラッシュアップ

本アプリの UI は極めてシンプルです。これでも特に問題はありませんが、やはりいまいち映えないです。使いやすさが損なわれない前提で、UI をブラッシュアップしてください。方向性(エレガント、ゴージャス、モダン等)は問いません。また Jetpack Compose の導入も OK です。

パースエラー

#3 のタスク

  • GitHubSearchViewModel
    ライブラリの問題はなさそう
  • Item
    build.gradleのバージョンは問題なさそう
  • RepositoryDetailFragment
    ライブラリの問題はなさそう
  • SearchActivity 問題はなさそう
  • SearchFragment
    問題はなさそう

テストを追加

現在のプログラムではテストがありません。UnitTest や UITest を追加してください。

例外の処理漏れ

#3 のタスク
例外処理の仕方をチェックし、きちんと例外が処理されているか確認する

  • GitHubSearchViewModel
    以下の可能性があるため、try-catchを用いて、修正した。
  • client?.get の呼び出し時にネットワーク接続エラーが発生する可能性
  • response?.receive() の呼び出し時にレスポンスの取得に失敗する可能性
  • jsonBody.optJSONArray("items") の呼び出し時にJSON形式が不正である場合に JSONException が発生する可能性
  • jsonItem?.optString や jsonItem?.optLong の呼び出し時にJSONのキーが存在しない場合に JSONException が発生する可能性
  • Item は例外処理の必要なし
  • RepositoryDetailFragment
    try-catch文もあると◎
  • SearchActivity 例外処理の必要なし
  • SearchFragment
    try-catch文を使用して、エラーメッセージを表示し、再度入力を促す

命名規則

#1 のタスク

  • #18
  • ローカル変数
  • ソースファイル名
  • プロパティ
  • パッケージ
  • クラス・オブジェクト
  • 関数

プログラム構造をリファクタリング

本プロジェクトは様々な原則に違反しています。下記のリストを参考にプログラムをリファクタリングしましょう。

  • DRY 原則
  • CQS 原則
  • 単一責任原則
  • インターフェイス分離の原則
  • 驚き最小の原則

Fat Fragment の回避

本プロジェクトは Fragment が必要以上の責務を抱えており、いわゆる Fat Fragment 状態です。最低限の責務の切り出しをしてあげましょう。

※本課題は #6 の下位互換です。

想定外のnullの握り潰し

#2 のタスク

  • GitHubSearchViewModel

  • return@runBlocking GlobalScope.async がきになるので、それも必要かも。
    #57 で修正

  • Item 想定外のnullの握り潰しなし

  • RepositoryDetailFragment
    SearchActivityで、lastSearchDateはnullを許容しているので、それを直す

  • SearchActivity 想定外のnullの握り潰しなし

  • SearchFragment

 binding.searchInputText.setOnEditorActionListener { editText, action, _ ->
            if (action == EditorInfo.IME_ACTION_SEARCH) {
                editText.text.toString().let {
                    viewModel.searchGithubRepositories(it).apply {
                        adapter.submitList(this)
                    }
                }
                return@setOnEditorActionListener true
            }
            return@setOnEditorActionListener false
        }

ネスト

#1 のタスク
Kotlinのコード

  • GitHubSearchViewModel
  • Item.kt
  • RepositoryDeatalFragment
  • SearchActivity
  • SearchFragment

以下を確認する

xmlのコード

  • activity_search
  • fragment_repostiroy_detail
  • fragment_search
  • layout_item

以下を元にチェック

ConstraintLayoutをネストすると激重になる

ゆめみの Android の採用コーディング試験を公開しました ネストを浅くしているか

ConstraintLayout でレスポンシブ UI を作成する

新機能を追加

本アプリの機能は極めて単純です。使いやすさが損なわれない前提で、様々な新機能を追加してあげてください。

アーキテクチャを適用

最近巷では MVC や MVVM などの GUI アーキテクチャから、Redux や VIPER などのアプリアーキテクチャまで様々なアーキテクチャが話題になっています。どれでもいいので本プロジェクトを自分の慣れたアーキテクチャに修正してください。

※本課題は #4 の上位互換です。

バグを修正

本プロジェクトには、至る所にバグが潜んでいます。下記のリストを参考にバグを修正してください。

メモリリーク

#3 のタスク
メモリリークについて
https://kotlinlang.org/docs/native-memory-manager.html
https://medium.com/@fauzisho/avoiding-memory-leaks-in-kotlin-and-jetpack-android-development-tips-and-examples-86a17bab47a7
https://ponsanlabo.com/kotlin-java-memory-leak-investigate/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.