agentskills.codes

Android core components lifecycle, Activities, Fragments, Services, Intent system.

Install

mkdir -p .claude/skills/platform-anirudhhhh && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14561" && unzip -o skill.zip -d .claude/skills/platform-anirudhhhh && rm skill.zip

Installs to .claude/skills/platform-anirudhhhh

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Android core components lifecycle, Activities, Fragments, Services, Intent system.
82 charsno explicit “when” trigger

About this 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 setup
  • onStart(): Become visible
  • onResume(): Gain focus
  • onPause(): Lose focus
  • onStop(): Hidden
  • onDestroy(): Final cleanup

Fragment Lifecycle

Similar to Activity but with:

  • onAttach(): Attached to activity
  • onDetach(): 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

Search skills

Search the agent skills registry