iosched README

The project's README from github.com/google/iosched. As one markdown file: README.md.

Google I/O Android App (ARCHIVED)

2023 Update

This repository has been archived. The Google I/O app has guided online and in-person visitors through the Google I/O conference for 10 years since 2009. It has also helped thousands of developers as an open-source sample.

To follow Modern Android Development best practices, check out the Now in Android repository, which replaces iosched as our real-world sample.

2021 Update

Due to global events, Google I/O 2020 was canceled and Google I/O 2021 is an online-only event, so the companion app hasn't been updated since 2019. However, the iosched team has continued adding several architecture improvements to its codebase. The general look and feel of the app is unchanged, and the app still uses the data from Google I/O 2019.

Major improvements implemented in 2021:

Description

Google I/O is a developer conference with several days of deep technical content featuring technical sessions and hundreds of demonstrations from developers showcasing their technologies.

This project is the Android app for the conference.

Running the app

The project contains a staging variant that replaces some modules at compile time so they don't depend on remote services such as Firebase. This allows you to try out and test the app without the API keys.

Features

The app displays a list of conference events - sessions, office hours, app reviews, codelabs, etc. - and allows the user to filter these events by event types and by topics (Android, Firebase, etc.). Users can see details about events, and they can star events that interest them. Conference attendees can reserve events to guarantee a seat.

Other features include a Map of the venue, informational pages to guide attendees during the conference in Info, and time-relevant information during the conference in Home.

Schedule screenshot

Development Environment

The app is written entirely in Kotlin and uses the Gradle build system.

To build the app, use the gradlew build command or use "Import Project" in Android Studio. Android Studio Arctic Fox or newer is required and may be downloaded here.

Architecture

The architecture is built around Android Architecture Components and follows the recommendations laid out in the Guide to App Architecture. Logic is kept away from Activities and Fragments and moved to ViewModels. Data is observed using Kotlin Flows and the Data Binding Library binds UI components in layouts to the app's data sources.

The Repository layer handles data operations. IOSched's data comes from a few different sources - user data is stored in Cloud Firestore (either remotely or in a local cache for offline use), user preferences and settings are stored in DataStore, conference data is stored remotely and is fetched and stored in memory for the app to use, etc. - and the repository modules are responsible for handling all data operations and abstracting the data sources from the rest of the app.

A lightweight domain layer sits between the data layer and the presentation layer, and handles discrete pieces of business logic off the UI thread. See the .\*UseCase.kt files under shared/domain for examples.

The Navigation component is used to implement navigation in the app, handling Fragment transactions and providing a consistent user experience.

Room is used for Full Text Search using Fts4 to search for a session, speaker, or codelab.

UI tests are written with Espresso and unit tests use Junit4 with Mockito when necessary.

The Jetpack Benchmark library makes it easy to benchmark your code from within Android Studio. The library handles warmup, measures your code performance, and outputs benchmarking results to the Android Studio console. We added a few benchmark tests around critical paths during app startup - in particular, the parsing of the bootstrap data. This enables us to automate measuring and monitoring initial startup time. Here is an example from a benchmark run:

Started running tests

Connected to process 30763 on device 'google-pixel_3'.
benchmark:
benchmark:    76,076,101 ns BootstrapConferenceDataSourceBenchmark.benchmark_json_parsing
Tests ran to completion.

Dependency Injection is implemented with Hilt. For more details on migrating from dagger-android to Hilt, read the (migration article.

ViewPager2 offers enhanced functionality over the original ViewPager library, such as right-to-left and vertical orientation support. For more details on migrating from ViewPager to ViewPager2, please see this migration guide.

Firebase

The app makes considerable use of the following Firebase components:

For 2020, the implementation was migrated to the Firebase Kotlin extension (KTX) libraries to write more idiomatic Kotlin code when calling Firebase APIs. To learn more, read this Firebase blog article on the Firebase KTX libraries.

Kotlin

The app is entirely written in Kotlin and uses Jetpack's Android Ktx extensions.

Asynchronous tasks are handled with coroutines. Coroutines allow for simple and safe management of one-shot operations as well as building and consuming streams of data using Kotlin Flows.

All build scripts are written with the Kotlin DSL.

Copyright

Copyright 2014 Google Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

iosched (google/iosched)

Searching Database…

21.6K ·GitHub
archived
这是什么?这是 Google I/O 开发者大会的官方配套 Android 应用:包含会议日程、codelab、会场地图,以及参会者的个人日程。代码已开源,仓库在 2023 年被归档。
这是参会者真正用过的应用,还是只是一个示例代码?两者都是。它为 I/O 的参观者服务了十年,Google 也一直把代码公开,作为 Android 开发的一个真实示例。它完全用 Kotlin 编写,所有构建脚本也都使用 Kotlin DSL。
我怎样才能把它跑起来?克隆仓库,然后在 Android Studio 里通过“Import Project”打开,或者用命令行执行 gradlew build 来构建。你需要 Android Studio Arctic Fox 或更新版本。
构建和运行它需要 Firebase API 密钥吗?试用不需要:staging 构建变体会在编译时替换掉依赖 Firebase 的模块,所以没有 API 密钥也能构建和运行。但预约座位这类完整功能依赖于 Firebase 服务。
这个应用现在还在维护吗?今天还能用吗?不能。Google 在 2023 年归档了这个仓库,应用自 2019 年起就不再更新,里面还是那一年的大会数据。Google 建议开发者改用“Now in Android”示例。
如果断网了,我收藏的活动怎么办?仍然可用:收藏和预约这类用户数据保存在 Cloud Firestore 中,并带有本地缓存供离线使用;而大会数据只获取一次,保存在内存里。
参会者在这个应用里实际能做些什么?它列出了大会的所有活动——分享会、office hours、应用评测、codelab——可以按活动类型和主题(Android、Firebase 等)筛选。用户可以收藏活动、预约座位以确保有位置,还能查看会场地图、信息页面,以及大会期间与时间相关的首页信息流。
它展示了哪些架构模式?它遵循 Google 的《应用架构指南》:逻辑放在 ViewModel 中,数据通过 Kotlin Flow 进行观察,仓库层把数据源封装起来,一个轻量的领域层在 UI 线程之外执行业务逻辑。依赖注入由 Hilt 处理,基于 Room 和 FTS4 的全文搜索覆盖分享会、讲师和 codelab。
这套代码是怎么测试的?UI 测试使用 Espresso,单元测试使用 JUnit4,必要时配合 Mockito,Jetpack Benchmark 则用来测量关键启动路径(比如启动数据解析)的性能,结果会显示在 Android Studio 控制台中。
Google 为什么停止更新它?Google I/O 2020 被取消,2021 年改为纯线上举办,这个配套应用没有大会可以服务,因此在 2019 年那一届之后就没有再更新。团队在此期间持续现代化代码——引入 Kotlin Flow、DataStore、大屏适配——最终在 2023 年将其归档,转而推荐“Now in Android”。
Creator
google
Size
56.7 MB
Stars
21.6K
Age
12y
Commits · 90 Days