Best use case
android-sdk is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Android SDK development tools. Use for native Android.
Teams using android-sdk should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/android-sdk/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How android-sdk Compares
| Feature / Agent | android-sdk | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Android SDK development tools. Use for native Android.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Android SDK
The traditional Android development toolkit (Views, Activities, Fragments, XML) using Kotlin/Java. Essential for maintaining the vast ecosystem of pre-Compose applications.
## When to Use
- Maintaining legacy Android applications (Views/XML).
- Building features requiring low-level system interactions not yet wrapped by Compose.
- Using libraries that strictly require Fragment/View interoperability.
## Quick Start
```kotlin
// build.gradle.kts: viewBinding = true
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.myButton.setOnClickListener {
Toast.makeText(this, "Clicked!", Toast.LENGTH_SHORT).show()
}
}
}
```
## Core Concepts
### Lifecycle
Understanding the complex lifecycle of Activities (`onCreate`, `onPause`, `onDestroy`) and Fragments is the hardest but most important part of legacy Android dev to prevent crashes and data loss.
### Intents
The messaging object used to request an action from another app component (starting activities, services, broadcasting).
### XML Layouts
Defining UI structure in XML files (`res/layout/activity_main.xml`).
## Common Patterns
### View Binding
Replaces `findViewById`. Generates type-safe binding classes for XML layouts.
- **Null Safety**: View references are nullable if they verify across configs.
- **Type Safety**: No casting required.
### Repository Pattern (Clean Architecture)
separating data sources (Room, Retrofit) from UI logic (ViewModel).
### Coroutines (Structured Concurrency)
Replacing `AsyncTask` and `Threads`.
- Use `lifecycleScope` and `viewModelScope` to automatically cancel tasks when the UI is destroyed.
## Best Practices
**Do**:
- Use **ViewBinding** instead of `findViewById` or Kotlin Synthetics (Deprecated).
- Use **Coroutines** for background tasks.
- Use **Dependency Injection** (Hilt) to manage complex graphs.
- Handle **Configuration Changes** (Rotation) using ViewModels.
**Don't**:
- Don't block the **Main Thread** (ANR Risk).
- Don't put business logic in Activities/Fragments (God Class anti-pattern).
- Don't ignore Fragment lifecycle (don't access views in `onDestroyView`).
## Troubleshooting
| Error | Cause | Solution |
| :--------------------------------------------- | :-------------------------------------------------- | :------------------------------------------ |
| `ANR (App Not Responding)` | Blocking main thread for >5s. | Move work to `Dispatchers.IO` (Coroutines). |
| `IllegalStateException: Fragment not attached` | Accessing context after detachment. | Check `isAdded` or use `MainScope` safely. |
| `Memory Leak` | Holding Activity reference in Singleton/Background. | Use `WeakReference` or Application Context. |
## References
- [Android Developer Guides](https://developer.android.com/guide)
- [Guide to App Architecture](https://developer.android.com/topic/architecture)Related Skills
android-studio
Android Studio IDE with emulator and profiler. Use for Android development.
template
Expert [skill-name] assistance covering [feature 1], [feature 2], and [feature 3]. Use when [working with X], [debugging Y], or [implementing Z].
zsh
Zsh shell with oh-my-zsh. Use for terminal shell.
zed
Zed high-performance collaborative editor. Use for fast editing.
xcode
Xcode Apple development IDE with simulators. Use for iOS/macOS development.
webstorm
WebStorm JavaScript IDE with debugging. Use for web development.
webpack
Webpack module bundler with loaders and plugins. Use for bundling.
warp
Warp modern terminal with AI. Use for terminal work.
vscode
Visual Studio Code editor with extensions and debugging. Use for code editing.
vite
Vite fast build tool with HMR. Use for modern frontend builds.
visual-studio
Visual Studio IDE for Windows with debugging and profiling. Use for .NET development.
vim
Vim text editor with motions, macros, and plugins. Use for terminal editing.