📦android / snippets
← 返回首页
Main repository for snippets surfaced on developer.android.com.
⚖️ Apache-2.0#snippets📅 创建于 2018-06-20🔄 更新于 2026-10-28
🔗 GitHub Kotlin

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有

Android Snippets

This repository holds code snippets used in Android documentation on developer.android.com.

The idea is that by having a small sample project that contains the code snippets from documentation, developers will gain more context on how to implement a specific API.

In addition, by having CI running on this repo, we can ensure that the code snippets on developer.android.com is in a working condition.

It is a work in progress, as many snippets are still embedded as static HTML.

Contributing

We love contributions! See CONTRIBUTING.md for guidelines.

Interactive Compose Previews (preview/)

The preview/ directory provides the interactive WebAssembly (Compose Multiplatform for Web) preview runner and Roborazzi screenshot generator used by developer.android.com:

  • preview/wasm: Compiles registered Material 3 Compose snippets from compose/snippets into an embeddable WebAssembly application (wasm.html + snippets-preview-wasm.mjs) with URL-driven theme, color preset, and density controls.
  • preview/generator: Generates 16:9 (768x432) monochrome static preview screenshots for every snippet in SnippetRegistry.kt using Robolectric Native Graphics and Roborazzi.

See preview/README.md for local build, screenshot generation, and development server instructions.

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR