Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

android-jetpack安卓喷气背包

Agent Skill

android-jetpack 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

396

周安装

17

GitHub Stars

4

下载量

139
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:android-jetpack(安卓喷气背包)
来源仓库:https://github.com/alphaonedev/openclaw-graph
仓库路径:skills/android-jetpack
安装命令:
npx skills add https://github.com/alphaonedev/openclaw-graph --skill android-jetpack
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/alphaonedev/openclaw-graph --skill android-jetpack

简介

集成 Android Jetpack 核心组件,提升应用稳定性与维护性。

  • 覆盖 Room 数据库、Navigation 组件、WorkManager 后台任务等关键模块。
  • 提供 CameraX 相机操作与 Paging 3 数据加载的最佳实践示例。
  • 使用前应评估各组件版本兼容性,避免因 API 差异导致运行时异常。
  • android-jetpack 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

android-jetpack

Purpose

This skill provides tools for integrating Android Jetpack components to build efficient, maintainable Android apps, focusing on Room for databases, Navigation for UI flows, WorkManager for background tasks, DataStore for preferences, CameraX for camera operations, Hilt for dependency injection, and Paging 3 for data loading.

When to Use

Use this skill when building Android apps that need persistent storage (e.g., Room for SQLite), navigation between screens (e.g., Navigation Component), scheduled tasks (e.g., WorkManager), secure preferences (e.g., DataStore), camera features (e.g., CameraX), modular dependency injection (e.g., Hilt), or efficient pagination (e.g., Paging 3). Apply it in apps with complex data flows, background processing, or hardware interactions.

Key Capabilities

  • Room: ORM for SQLite databases; supports entities, DAOs, and migrations.
  • Navigation: Manages fragment transactions and deep links via NavController.
  • WorkManager: Schedules deferrable tasks with constraints like network availability.
  • DataStore: Replaces SharedPreferences with protocol buffers for typed storage.
  • CameraX: Abstracts camera hardware for preview, capture, and analysis.
  • Hilt: Simplifies Dagger for dependency injection with Android-specific annotations.
  • Paging 3: Loads data in pages for lists, integrating with LiveData or Flow.

Usage Patterns

To use Room, add the dependency in build.gradle: implementation 'androidx.room:room-runtime:2.5.0'. Define an Entity: @Entity class User(val id: Int, val name: String). Create a DAO: interface UserDao {@Query("SELECT * FROM user") fun getAll(): List<User>}. Set up the database: Room.databaseBuilder(context, AppDatabase::class.java, "database-name").build().

For Navigation, add in build.gradle: implementation 'androidx.navigation:navigation-fragment-ktx:2.5.0'. Create a Nav Graph in XML: <navigation xmlns:android="http://schemas.android.com/apk/res/android"...> <fragment android:id="@+id/mainFragment"...> <action android:id="@+id/action_to_detail" app:destination="@id/detailFragment" /> </fragment> </navigation>. Navigate in code: findNavController().navigate(R.id.action_to_detail).

Integrate Hilt by adding: implementation 'com.google.dagger:hilt-android:2.44'. Annotate your application: @HiltAndroidApp class MyApp: Application(). Inject dependencies: @AndroidEntryPoint class MainActivity: AppCompatActivity() {@Inject lateinit var viewModel: MyViewModel}.

For WorkManager, enqueue a task: WorkManager.getInstance(context).enqueue(OneTimeWorkRequestBuilder<MyWorker>().build()). Define the worker: class MyWorker(context: Context, params: WorkerParameters): Worker(context, params) {override fun doWork(): Result {// Perform task return Result.success()}}.

Use DataStore for preferences: Add implementation 'androidx.datastore:datastore-preferences:1.0.0'. Access it: val dataStore = applicationContext.dataStore. Read/write: dataStore.edit {settings -> settings[STRING_KEY] = "value"}.

With CameraX, bind the camera: ProcessCameraProvider.getInstance(context).use {provider -> val camera = provider.bindToLifecycle(this, cameraSelector, preview)}. Configure preview: val preview = Preview.Builder().build().also {it.setSurfaceProvider(viewFinder.surfaceProvider)}.

For Paging 3, create a PagingSource: class UserPagingSource: PagingSource<Int, User>() {override suspend fun load(params: LoadParams<Int>): LoadResult<Int, User> {// Fetch data return LoadResult.Page(data, prevKey, nextKey)}}. Use in ViewModel: val pager = Pager(config) {UserPagingSource()}.flow.

Common Commands/API

  • Room CLI: Use ./gradlew dependencies to verify Room integration. For migrations, run database queries via ADB: adb shell sqlite3 /data/data/your.package/databases/yourdb "PRAGMA user_version;".
  • Navigation API: Call NavController.navigate(actionId) for transitions. Use deep links: <deepLink app:uri="yourapp://details/{id}" /> in Nav Graph.
  • WorkManager API: Enqueue with constraints: OneTimeWorkRequestBuilder<MyWorker>().setConstraints(Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build()).build(). Query status: WorkManager.getInstance().getWorkInfosForUniqueWork("workName").observe(...).
  • DataStore API: Read preferences: dataStore.data.map {preferences -> preferences[STRING_KEY]}. Handle flows: Use collect {value -> /* process */}.
  • CameraX API: Capture image: imageCapture.takePicture(outputFileOptions, executor, object: ImageCapture.OnImageSavedCallback {override fun onImageSaved(output: ImageCapture.OutputFileResults) {// Handle saved file}}).
  • Hilt API: Generate code with ./gradlew hiltGenerateSources. Inject modules: @Module @InstallIn(SingletonComponent::class) class AppModule {@Provides fun provideService(): Service = Service()}.
  • Paging 3 API: Combine with RemoteMediator for network + DB: Pager(config = PagingConfig(pageSize = 20), remoteMediator = UserRemoteMediator(), pagingSourceFactory = {UserPagingSource()}).

Integration Notes

Integrate Room with Hilt by annotating the database: @Database(entities = [User::class], version = 1) @HiltDatabase abstract class AppDatabase: RoomDatabase() {abstract fun userDao(): UserDao}. For WorkManager and Navigation, observe work status in a fragment: WorkManager.getInstance().getWorkInfoByIdLiveData(workId).observe(viewLifecycleOwner) {info -> if (info.state == WorkInfo.State.SUCCEEDED) navigateToResult()}. Use DataStore with Paging: Store pagination keys in DataStore and retrieve via flows. For CameraX, ensure permissions: Check with ContextCompat.checkSelfPermission(context, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED. If API keys are needed (e.g., for external services in WorkManager), use env vars like $GOOGLE_API_KEY in build.gradle or strings.xml. Combine Paging with Room: Use Room as the data source in PagingSource.

Error Handling

For Room, catch SQLite exceptions: try {dao.insert(user)} catch (e: SQLiteConstraintException) {Log.e("RoomError", e.message?: "Constraint violation")}. Handle Navigation errors: Use NavController.addOnDestinationChangedListener to catch invalid actions. For WorkManager, check Result.retry() in doWork: if (error) return Result.retry(). DataStore errors: Wrap reads in try-catch for IOException. CameraX: Handle CameraX.bindToLifecycle failures with try {provider.unbindAll()} catch (e: IllegalStateException) {Log.e("CameraError", "Binding failed")}. Hilt: Resolve injection errors by checking @Inject annotations and running ./gradlew clean. Paging 3: Catch LoadState errors: pager.loadStateFlow.collect {state -> if (state.refresh is LoadState.Error) Log.e("PagingError", state.refresh.error.message?: "Load failed")}.

Concrete Usage Examples

  1. Example: User app with Room and Hilt: In a ViewModel, inject Room DAO: @HiltViewModel class UserViewModel @Inject constructor(private val userDao: UserDao): ViewModel() {fun getUsers() = userDao.getAll()}. In Activity: Use Hilt to inject and display: viewModel.getUsers().observe(this) {users -> adapter.submitList(users)}.
  2. Example: Background sync with WorkManager and DataStore: Enqueue a worker to fetch data and store in DataStore: WorkManager.enqueue(OneTimeWorkRequestBuilder<SyncWorker>().build()). In worker: dataStore.edit {it[LAST_SYNC_KEY] = System.currentTimeMillis()}. Then, in UI, read from DataStore to check last sync.

Graph Relationships

  • Room depends on: Android core (for SQLite) and Hilt (for injection).
  • Navigation integrates with: WorkManager (for async nav) and Paging 3 (for list navigation).
  • WorkManager relates to: DataStore (for storing results) and CameraX (for background processing).
  • DataStore connects to: Room (as an alternative storage) and Hilt (for injected access).
  • CameraX links to: Navigation (for camera UI flow).
  • Hilt provides injection for: All other components (Room, WorkManager, etc.).
  • Paging 3 works with: Room (as data source) and Navigation (for infinite lists).

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.34%
按下载量换算48

Claude

32.97%
按下载量换算46

Cursor

17.97%
按下载量换算25

Gemini CLI

9.9%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/alphaonedev/openclaw-graph --skill android-jetpack 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills