用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/G1Joshi/Agent-Skills --skill android-sdk命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | android-sdk |
| description | Android SDK development tools. Use for native Android. |
The traditional Android development toolkit (Views, Activities, Fragments, XML) using Kotlin/Java. Essential for maintaining the vast ecosystem of pre-Compose applications.
// build.gradle.kts: viewBinding = true
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.myButton.setOnClickListener {
Toast.makeText(this, "Clicked!", Toast.LENGTH_SHORT).show()
}
}
}
Understanding the complex lifecycle of Activities (onCreate, onPause, onDestroy) and Fragments is the hardest but most important part of legacy Android dev to prevent crashes and data loss.
The messaging object used to request an action from another app component (starting activities, services, broadcasting).
Defining UI structure in XML files (res/layout/activity_main.xml).
Replaces findViewById. Generates type-safe binding classes for XML layouts.
separating data sources (Room, Retrofit) from UI logic (ViewModel).
Replacing AsyncTask and Threads.
lifecycleScope and viewModelScope to automatically cancel tasks when the UI is destroyed.Do:
findViewById or Kotlin Synthetics (Deprecated).Don't:
onDestroyView).| Error | Cause | Solution |
|---|---|---|
ANR (App Not Responding) | Blocking main thread for >5s. | Move work to Dispatchers.IO (Coroutines). |
IllegalStateException: Fragment not attached | Accessing context after detachment. | Check isAdded or use MainScope safely. |
Memory Leak | Holding Activity reference in Singleton/Background. | Use WeakReference or Application Context. |