platform
3
总安装量
2
周安装量
#57413
全站排名
安装命令
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-android --skill platform
Agent 安装分布
claude-code
2
mcpjam
1
moltbot
1
windsurf
1
zencoder
1
Skill 文档
Android Platform Skill
Quick Start
Activity Lifecycle
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
override fun onDestroy() {
super.onDestroy()
// Cleanup
}
}
Fragment Usage
class UserFragment : Fragment() {
private val viewModel: UserViewModel by viewModels()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
viewModel.user.observe(viewLifecycleOwner) { user ->
updateUI(user)
}
}
}
Key Concepts
Lifecycle Callbacks
onCreate(): Initial setuponStart(): Become visibleonResume(): Gain focusonPause(): Lose focusonStop(): HiddenonDestroy(): Final cleanup
Fragment Lifecycle
Similar to Activity but with:
onAttach(): Attached to activityonDetach(): Detached- Fragment manager for transactions
Intent System
// Explicit
startActivity(Intent(this, DetailActivity::class.java))
// Implicit
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://example.com")))
Services
- Started:
startService() - Bound:
bindService() - Foreground: Visible notification
Best Practices
â Handle lifecycle properly â Use ViewModel for state â Unregister listeners â Test configuration changes â Respect process lifecycle