platform

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

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "platform" with this command: npx skills add pluginagentmarketplace/custom-plugin-android/pluginagentmarketplace-custom-plugin-android-platform

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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

production

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

architecture

No summary provided by upstream source.

Repository SourceNeeds Review