Agent skill
platform
Android core components lifecycle, Activities, Fragments, Services, Intent system.
Install this agent skill to your Project
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-android/tree/main/skills/platform
SKILL.md
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
Resources
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
ui
XML layouts, ConstraintLayout, Jetpack Compose, Material Design 3.
data
Room ORM, SQLite, SharedPreferences, DataStore, encryption.
architecture
MVVM pattern, Clean Architecture, Repository pattern, dependency injection, SOLID principles.
production
Unit testing, performance optimization, security implementation, Play Store deployment.
networking
Retrofit, OkHttp, REST APIs, JSON serialization, network security.
fundamentals
Master Kotlin syntax, OOP principles, SOLID practices, functional programming, and data structures.
Didn't find tool you were looking for?