mobile-development-skill
Master iOS, Android, React Native, and Flutter development. Build native and cross-platform mobile apps with modern frameworks, handle platform-specific features, optimize performance, and deploy to app stores.
What this skill does
# Mobile Development Skill
Build powerful mobile applications across iOS, Android, and cross-platform platforms.
## Quick Start
### Choose Your Platform
```
Native Only Cross-Platform
├─ iOS (Swift) ├─ React Native
├─ Android (Kotlin) └─ Flutter
```
### Decision Matrix
| | iOS | Android | React Native | Flutter |
|---|---|---|---|---|
| **Learning Curve** | Medium | Medium | Easy (know JS) | Medium |
| **Performance** | Excellent | Excellent | Very Good | Excellent |
| **Code Sharing** | None | None | 70% | 80%+ |
| **Market Share** | 25% | 72% | Common | Growing |
| **Team Skills** | Xcode, Swift | Android Studio, Kotlin | JS/React | Dart |
---
## iOS Development
### **Swift Fundamentals**
```swift
// Variables and types
var name: String = "Alice"
let age: Int = 30 // immutable
// Optionals (handle nil safely)
var email: String? = nil
if let email = email {
print("Email: \(email)")
}
// Functions
func greet(_ name: String) -> String {
return "Hello, \(name)!"
}
// Classes vs Structs
class Person {
var name: String
init(name: String) {
self.name = name
}
}
struct Address {
var street: String
var city: String
}
// Extensions (add methods to existing types)
extension String {
func capitalized() -> String {
return self.prefix(1).uppercased() + self.dropFirst()
}
}
```
### **SwiftUI (Modern Approach)**
```swift
import SwiftUI
struct ContentView: View {
@State private var count = 0
@State private var name: String = ""
var body: some View {
VStack(spacing: 20) {
Text("Hello, World!")
.font(.title)
.foregroundColor(.blue)
TextField("Enter name", text: $name)
.textFieldStyle(.roundedBorder)
.padding()
Button(action: { count += 1 }) {
Text("Count: \(count)")
.font(.headline)
.foregroundColor(.white)
.frame(maxWidth: .infinity)
.padding()
.background(Color.blue)
.cornerRadius(10)
}
List {
ForEach(0..<5, id: \.self) { index in
Text("Item \(index)")
}
}
}
.padding()
}
}
// Preview
#Preview {
ContentView()
}
```
### **iOS Lifecycle & Navigation**
```swift
// App Delegate (lifecycle)
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
// Navigation
NavigationStack {
VStack {
NavigationLink(value: 42) {
Text("Go to Details")
}
}
.navigationDestination(for: Int.self) { id in
DetailView(id: id)
}
}
```
### **Networking & Async/Await**
```swift
struct User: Codable {
let id: Int
let name: String
let email: String
}
// MVVM Pattern
@MainActor
class UserViewModel: ObservableObject {
@Published var users: [User] = []
@Published var isLoading = false
@Published var error: String?
func fetchUsers() async {
isLoading = true
defer { isLoading = false }
do {
let url = URL(string: "https://api.example.com/users")!
let (data, _) = try await URLSession.shared.data(from: url)
users = try JSONDecoder().decode([User].self, from: data)
} catch {
self.error = error.localizedDescription
}
}
}
// Use in View
struct UserListView: View {
@StateObject private var viewModel = UserViewModel()
var body: some View {
List(viewModel.users) { user in
VStack(alignment: .leading) {
Text(user.name).font(.headline)
Text(user.email).font(.caption)
}
}
.task {
await viewModel.fetchUsers()
}
}
}
```
---
## Android Development
### **Kotlin Fundamentals**
```kotlin
// Variables
var name: String = "Alice"
val age: Int = 30 // immutable
// Nullable types
var email: String? = null
email?.let { println(it) } // Safe call
// Functions
fun greet(name: String): String = "Hello, $name!"
// Data classes
data class User(val id: Int, val name: String, val email: String)
// Extension functions
fun <T> List<T>.printAll() {
forEach { println(it) }
}
// Higher-order functions
val numbers = listOf(1, 2, 3, 4, 5)
numbers
.filter { it > 2 }
.map { it * 2 }
.forEach { println(it) }
```
### **Jetpack Compose (Modern UI)**
```kotlin
import androidx.compose.material3.*
import androidx.compose.runtime.*
@Composable
fun UserProfile(userId: String) {
var user by remember { mutableStateOf<User?>(null) }
var isLoading by remember { mutableStateOf(true) }
LaunchedEffect(userId) {
user = fetchUser(userId)
isLoading = false
}
Scaffold(
topBar = { TopAppBar(title = { Text("Profile") }) }
) { padding ->
Box(modifier = Modifier.padding(padding)) {
when {
isLoading -> CircularProgressIndicator()
user != null -> {
Column {
Text(user!!.name, style = MaterialTheme.typography.headlineMedium)
Text(user!!.email)
}
}
}
}
}
}
@Preview
@Composable
fun PreviewUserProfile() {
UserProfile("123")
}
```
### **Android Lifecycle & Architecture**
```kotlin
// MVVM with LiveData
class UserViewModel : ViewModel() {
private val _users = MutableLiveData<List<User>>()
val users: LiveData<List<User>> = _users
fun loadUsers() {
viewModelScope.launch {
try {
val data = apiService.getUsers()
_users.value = data
} catch (e: Exception) {
// Handle error
}
}
}
}
// Activity
class MainActivity : AppCompatActivity() {
private val viewModel: UserViewModel by viewModels()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
viewModel.users.observe(this) { users ->
adapter.submitList(users)
}
viewModel.loadUsers()
}
}
```
### **Networking with Retrofit**
```kotlin
interface ApiService {
@GET("users")
suspend fun getUsers(): List<User>
@POST("users")
suspend fun createUser(@Body user: User): User
@GET("users/{id}")
suspend fun getUser(@Path("id") id: Int): User
}
// Dependency Injection (Hilt)
@Module
@InstallIn(SingletonComponent::class)
object NetworkModule {
@Provides
fun provideApiService(): ApiService {
return Retrofit.Builder()
.baseUrl("https://api.example.com/")
.addConverterFactory(GsonConverterFactory.create())
.build()
.create(ApiService::class.java)
}
}
```
---
## React Native
### **Setup & Basics**
```javascript
import React, { useState, useEffect } from 'react';
import { View, Text, ScrollView, TouchableOpacity } from 'react-native';
export default function App() {
const [users, setUsers] = useState([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
fetchUsers();
}, []);
const fetchUsers = async () => {
try {
const response = await fetch('https://api.example.com/users');
const data = await response.json();
setUsers(data);
} catch (error) {
console.error(error);
} finally {
setLoading(false);
}
};
return (
<ScrollView>
{loading ? (
<Text>Loading...</Text>
) : (
users.map(user => (
<TouchableOpacity key={user.id}>
<Text>{user.name}</Text>
</TouchableOpacity>
))
)}
</ScrollView>
);
}
```
### **Navigation (React Navigation)**
```javascript
import { NavigationCRelated in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.