Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONで天気を取得する #21

Open
4 tasks
github-actions bot opened this issue Apr 15, 2024 · 0 comments
Open
4 tasks

JSONで天気を取得する #21

github-actions bot opened this issue Apr 15, 2024 · 0 comments
Labels
Compose Jetpack ComposeでUIを作成する課題です View View(XMLレイアウト)でUIを作成する課題です 必須 必ず取り組む課題です

Comments

@github-actions
Copy link

📄 JSON形式で天気を取得しましょう

Note

Required(先に完了させましょう)

Next(次に取り組みましょう)

課題内容

  • データモデルを定義する
  • kotlin.serializationでJSONをデコードする
  • 天気情報の取得をJSON形式のAPIに置き換える
  • 取得した天気・温度・地名を画面に表示する

利用するAPI

YumemiWeather

   suspend fun fetchJsonWeatherAsync(json: String) : String
  • ランダムにエラーが発生してUnknownExceptionをthrowします
  • ランダムな天気情報をJSON形式の文字列で返します

Parameter

Json文字列

Key フォーマット
area String 任意 東京
date String ISO8601拡張形式 "yyyy-MM-dd'T'HH:mm" 2020-04-01T12:00

Returns

Json文字列

Key フォーマット
weather String sunny, cloudy, rainy, snow sunny
maxTemp Int -- 20
minTemp Int -- -20
date String ISO8601拡張形式 "yyyy-MM-dd'T'HH:mm" 2020-04-01T12:00
area String requestと同じ 東京

動作イメージ

参考資料

@github-actions github-actions bot added Compose Jetpack ComposeでUIを作成する課題です View View(XMLレイアウト)でUIを作成する課題です 必須 必ず取り組む課題です labels Apr 15, 2024
@github-actions github-actions bot added this to the 4. APIの利用 milestone Apr 15, 2024
@github-actions github-actions bot mentioned this issue Apr 15, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compose Jetpack ComposeでUIを作成する課題です View View(XMLレイアウト)でUIを作成する課題です 必須 必ず取り組む課題です
Projects
None yet
Development

No branches or pull requests

0 participants