Android Platform Components

VerifiedSafe

Android core components: lifecycle of Activities, Fragments, Services, and Intent system.

Sby Skills Guide Bot
DevelopmentIntermediate
7/23/2026
Claude Code
#android#android-lifecycle#activities#fragments#intents

Recommended for

Automated summary

This skill offers reference guidance on Android's core components — Activity and Fragment lifecycles, Services, and the Intent system — backed by short Kotlin snippets.

Strengths

  • Explains Activity and Fragment lifecycle callbacks with a concrete Kotlin example
  • Covers explicit and implicit Intents plus the three Service modes (started, bound, foreground)
  • States key best practices: use ViewModel for state, unregister listeners, test configuration changes
  • Declares validated parameters (component, lifecycle_state) that scope the answers

Limitations

  • Deliberately introductory: little on coroutines, modern navigation, or Compose
  • Permissions are only mentioned as a parameter option, not explored in depth
  • Snippets are minimal and need adapting to a real project architecture
When to use it

Reach for it when explaining or fixing Activity/Fragment lifecycle behavior, picking a Service type, or building an Intent on Android.

When not to use it

Skip it for advanced Compose, declarative navigation, or low-level performance questions, which it does not cover.

Security analysis

Safe
Quality score78/100

The skill contains only Android platform documentation and code snippets. It declares no tools, executes no commands, and makes no network, filesystem, or credential-related requests.

No concerns found

How this analysis is made

Examples

Fix a lifecycle leak
My Fragment registers a BroadcastReceiver in onCreateView and crashes after rotation. Show me the correct lifecycle callbacks to register and unregister it.
Choose a service type
I need background music playback that keeps running when the app is backgrounded on Android. Should I use a started, bound, or foreground Service, and why?
Launch with an implicit intent
Write Kotlin code that opens a web URL with an implicit ACTION_VIEW Intent and handles the case where no app can handle it.

name: platform description: Android core components lifecycle, Activities, Fragments, Services, Intent system. version: "2.0.0" sasmp_version: "1.3.0"

Agent Binding

bonded_agent: 02-platform bond_type: PRIMARY_BOND

Skill Configuration

atomic: true single_responsibility: Android platform components & lifecycle

Parameter Validation

parameters: component: type: string enum: [activity, fragment, service, intent, permission] required: false lifecycle_state: type: string required: false

Retry Configuration

retry: max_attempts: 2 backoff: exponential on_failure: return_lifecycle_diagram

Observability

logging: level: info include: [query, component_type, response_time]

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

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/android-platform-components-mrx3xwoo/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/android-platform-components-mrx3xwoo' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/android-platform-components-mrx3xwoo/download' --output '.skill-downloads/android-platform-components-mrx3xwoo/SKILL.md.part' && mv '.skill-downloads/android-platform-components-mrx3xwoo/SKILL.md.part' '.skill-downloads/android-platform-components-mrx3xwoo/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/android-platform-components-mrx3xwoo/SKILL.md' && test -s '.skill-downloads/android-platform-components-mrx3xwoo/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/platform' && cp -R '.skill-downloads/android-platform-components-mrx3xwoo' '.claude/skills/platform'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/android-platform-components-mrx3xwoo'

openskills read 'android-platform-components-mrx3xwoo'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/android-platform-components-mrx3xwoo/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills