Mobile Development Guide
Master native and cross-platform mobile development for iOS and Android platforms.
Quick Start
iOS with Swift
import SwiftUI
struct ContentView: View {
@State private var todos: [String] = []
@State private var newTodo = ""
var body: some View {
VStack {
TextField("Add todo", text: $newTodo)
Button("Add") {
todos.append(newTodo)
newTodo = ""
}
List {
ForEach(todos, id: \.self) { todo in
Text(todo)
}
}
}
}
}
Android with Kotlin
import androidx.compose.material3.Button
import androidx.compose.material3.TextField
import androidx.compose.runtime.mutableStateOf
@Composable
fun TodoApp() {
var todos by remember { mutableStateOf(listOf<String>()) }
var newTodo by remember { mutableStateOf("") }
Column {
TextField(
value = newTodo,
newTodo = it },
label = { Text("Add todo") }
)
Button(onClick = {
todos = todos + newTodo
newTodo = ""
}) {
Text("Add")
}
LazyColumn {
items(todos) { todo ->
Text(todo)
}
}
}
}
React Native
import React, { useState } from 'react';
import { View, TextInput, TouchableOpacity, FlatList, Text } from 'react-native';
export default function TodoApp() {
const [todos, setTodos] = useState([]);
const [input, setInput] = useState('');
const addTodo = () => {
setTodos([...todos, input]);
setInput('');
};
return (
<View>
<TextInput
placeholder="Add todo"
value={input}
/>
<TouchableOpacity
<Text>Add</Text>
</TouchableOpacity>
<FlatList
data={todos}
renderItem={({ item }) => <Text>{item}</Text>}
/>
</View>
);
}
Flutter
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class TodoApp extends StatefulWidget {
const TodoApp({Key? key}) : super(key: key);
@override
State<TodoApp> createState() => _TodoAppState();
}
class _TodoAppState extends State<TodoApp> {
List<String> todos = [];
TextEditingController controller = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
TextField(controller: controller),
ElevatedButton(
onPressed: () {
setState(() => todos.add(controller.text));
controller.clear();
},
child: const Text('Add'),
),
Expanded(
child: ListView.builder(
itemCount: todos.length,
itemBuilder: (context, index) => Text(todos[index]),
),
),
],
),
);
}
}
iOS Development Path
Swift Basics
- Variables & Types: var, let, type safety
- Functions: Parameters, return types, closures
- Structs & Classes: Value vs reference types
- Error Handling: try/catch, Result type
- Concurrency: async/await, actors
UI Frameworks
iOS Architecture
- MVC: Model-View-Controller
- MVVM: Model-View-ViewModel with observable
- CLEAN: Entity, Use Case, Interface
- Coordinator Pattern: Navigation management
Key Frameworks
- Foundation: Core utilities and data types
- CoreData: Local persistence
- Networking: URLSession for API calls
- CoreLocation: Location services
- AVFoundation: Camera and media
Android Development Path
Kotlin Basics
- Variables & Functions: val, var, fun
- Classes & Objects: Data classes, sealed classes
- Extension Functions: Adding methods to types
- Coroutines: async/await equivalent
- Flow: Reactive streams
UI Frameworks
Android Architecture
- MVC: Model-View-Controller
- MVVM: ViewModel, LiveData, Data Binding
- CLEAN: Separation of concerns
- Repository Pattern: Data abstraction
Key Libraries
- Jetpack Components: Room, Lifecycle, ViewModel
- Retrofit: HTTP client
- Hilt: Dependency injection
- Firebase: Analytics, push notifications
Cross-Platform: React Native
Setup & Development
- Expo: Managed development environment
- React Native CLI: Full control
- Navigation: React Navigation
- State Management: Redux, Context API
Advantages & Tradeoffs
- Pros: Code sharing, JavaScript ecosystem
- Cons: Performance, native feel, tooling maturity
Best Practices
- Platform-specific code separation
- Native module development
- Performance optimization
- Bridge communication with native
Cross-Platform: Flutter
Setup & Development
- Dart Language: Flutter's language
- Widget Tree: UI composition
- State Management: Provider, Riverpod, Bloc
- Navigation: Named routes, deep linking
Advantages
- Performance: Compiled to native
- Hot Reload: Fast development
- Beautiful UI: Rich widget library
- Single Codebase: iOS and Android
Ecosystem
- Pub.dev: Package registry
- Popular Packages: http, provider, get
- Plugins: Native functionality access
- Firebase Integration: Easy setup
Mobile Development Essentials
Networking
- REST APIs: JSON parsing, error handling
- GraphQL: Mobile query language
- Offline Sync: Local storage, sync strategies
- SSL Pinning: Security
Local Data
- SQLite: Structured data
- Key-Value Storage: SharedPreferences, UserDefaults
- File System: Documents, cache directories
Authentication
- OAuth 2.0: Third-party login
- JWT: Token-based auth
- Biometric: Face ID, fingerprint
- Session Management: Token refresh
Testing
- Unit Tests: Business logic
- Widget/Component Tests: UI testing
- Integration Tests: Full app flows
- UI Automation: End-to-end testing
Deployment
iOS
- Apple Developer Account registration
- Create certificates and identifiers
- Build and archive app
- Submit to App Store
- Review and approval (1-3 days)
Android
- Google Play Account registration
- Create signing certificate
- Build release APK/AAB
- Upload to Google Play
- Testing and release (instant)
Publishing Best Practices
- App Store Optimization (ASO)
- Beta testing programs
- Update strategy
- Versioning and release notes
Projects
- Todo App - Basic CRUD, storage
- Weather App - API integration, UI
- Chat Application - Real-time, networking
- E-commerce App - Complex UI, payments
- Fitness Tracker - Sensors, data analysis
Resources
Learning Platforms
- Udemy: Framework-specific courses
- Pluralsight: In-depth iOS/Android paths
- Google Codelabs: Official Android tutorials
- Apple Developer: Official iOS resources
Documentation
Communities
- Stack Overflow: Question and answers
- Reddit: r/iOSProgramming, r/android, r/flutterdev
- GitHub: Open source projects
- Local Meetups: Developer communities
Roadmap.sh Reference: https://roadmap.sh/mobile
Status: ✅ Production Ready | SASMP: v1.3.0 | Bonded Agent: 05-mobile-specialist
1---2name: mobile-guide3description: Comprehensive mobile development guide for iOS, Android, React Native, and Flutter. Includes Swift, Kotlin, and cross-platform frameworks. Use when building mobile applications, iOS, Android, or cross-platform apps.4---56# Mobile Development Guide78Master native and cross-platform mobile development for iOS and Android platforms.910## Quick Start1112### iOS with Swift13```swift14import SwiftUI1516struct ContentView: View {17 @State private var todos: [String] = []18 @State private var newTodo = ""1920 var body: some View {21 VStack {22 TextField("Add todo", text: $newTodo)23 Button("Add") {24 todos.append(newTodo)25 newTodo = ""26 }2728 List {29 ForEach(todos, id: \.self) { todo in30 Text(todo)31 }32 }33 }34 }35}36```3738### Android with Kotlin39```kotlin40import androidx.compose.material3.Button41import androidx.compose.material3.TextField42import androidx.compose.runtime.mutableStateOf4344@Composable45fun TodoApp() {46 var todos by remember { mutableStateOf(listOf<String>()) }47 var newTodo by remember { mutableStateOf("") }4849 Column {50 TextField(51 value = newTodo,52 onValueChange = { newTodo = it },53 label = { Text("Add todo") }54 )55 Button(onClick = {56 todos = todos + newTodo57 newTodo = ""58 }) {59 Text("Add")60 }6162 LazyColumn {63 items(todos) { todo ->64 Text(todo)65 }66 }67 }68}69```7071### React Native72```javascript73import React, { useState } from 'react';74import { View, TextInput, TouchableOpacity, FlatList, Text } from 'react-native';7576export default function TodoApp() {77 const [todos, setTodos] = useState([]);78 const [input, setInput] = useState('');7980 const addTodo = () => {81 setTodos([...todos, input]);82 setInput('');83 };8485 return (86 <View>87 <TextInput88 placeholder="Add todo"89 value={input}90 onChangeText={setInput}91 />92 <TouchableOpacity onPress={addTodo}>93 <Text>Add</Text>94 </TouchableOpacity>9596 <FlatList97 data={todos}98 renderItem={({ item }) => <Text>{item}</Text>}99 />100 </View>101 );102}103```104105### Flutter106```dart107import 'package:flutter/material.dart';108109void main() {110 runApp(const MyApp());111}112113class TodoApp extends StatefulWidget {114 const TodoApp({Key? key}) : super(key: key);115116 @override117 State<TodoApp> createState() => _TodoAppState();118}119120class _TodoAppState extends State<TodoApp> {121 List<String> todos = [];122 TextEditingController controller = TextEditingController();123124 @override125 Widget build(BuildContext context) {126 return Scaffold(127 body: Column(128 children: [129 TextField(controller: controller),130 ElevatedButton(131 onPressed: () {132 setState(() => todos.add(controller.text));133 controller.clear();134 },135 child: const Text('Add'),136 ),137 Expanded(138 child: ListView.builder(139 itemCount: todos.length,140 itemBuilder: (context, index) => Text(todos[index]),141 ),142 ),143 ],144 ),145 );146 }147}148```149150## iOS Development Path151152### Swift Basics153- **Variables & Types**: var, let, type safety154- **Functions**: Parameters, return types, closures155- **Structs & Classes**: Value vs reference types156- **Error Handling**: try/catch, Result type157- **Concurrency**: async/await, actors158159### UI Frameworks160- **SwiftUI**: Modern declarative UI (recommended)161 - Views, state management, modifiers162 - Navigation, animation, gestures163 - Data binding with @State, @ObservedObject164165- **UIKit**: Older imperative framework166 - View controllers, navigation stack167 - Delegates and data sources168 - Auto Layout constraints169170### iOS Architecture171- **MVC**: Model-View-Controller172- **MVVM**: Model-View-ViewModel with observable173- **CLEAN**: Entity, Use Case, Interface174- **Coordinator Pattern**: Navigation management175176### Key Frameworks177- **Foundation**: Core utilities and data types178- **CoreData**: Local persistence179- **Networking**: URLSession for API calls180- **CoreLocation**: Location services181- **AVFoundation**: Camera and media182183## Android Development Path184185### Kotlin Basics186- **Variables & Functions**: val, var, fun187- **Classes & Objects**: Data classes, sealed classes188- **Extension Functions**: Adding methods to types189- **Coroutines**: async/await equivalent190- **Flow**: Reactive streams191192### UI Frameworks193- **Jetpack Compose**: Modern declarative UI (recommended)194 - Composables, state hoisting195 - Layouts and modifiers196 - Navigation, animation197198- **XML Layouts**: Traditional approach199 - Activity, Fragment architecture200 - View binding, data binding201202### Android Architecture203- **MVC**: Model-View-Controller204- **MVVM**: ViewModel, LiveData, Data Binding205- **CLEAN**: Separation of concerns206- **Repository Pattern**: Data abstraction207208### Key Libraries209- **Jetpack Components**: Room, Lifecycle, ViewModel210- **Retrofit**: HTTP client211- **Hilt**: Dependency injection212- **Firebase**: Analytics, push notifications213214## Cross-Platform: React Native215216### Setup & Development217- **Expo**: Managed development environment218- **React Native CLI**: Full control219- **Navigation**: React Navigation220- **State Management**: Redux, Context API221222### Advantages & Tradeoffs223- **Pros**: Code sharing, JavaScript ecosystem224- **Cons**: Performance, native feel, tooling maturity225226### Best Practices227- Platform-specific code separation228- Native module development229- Performance optimization230- Bridge communication with native231232## Cross-Platform: Flutter233234### Setup & Development235- **Dart Language**: Flutter's language236- **Widget Tree**: UI composition237- **State Management**: Provider, Riverpod, Bloc238- **Navigation**: Named routes, deep linking239240### Advantages241- **Performance**: Compiled to native242- **Hot Reload**: Fast development243- **Beautiful UI**: Rich widget library244- **Single Codebase**: iOS and Android245246### Ecosystem247- **Pub.dev**: Package registry248- **Popular Packages**: http, provider, get249- **Plugins**: Native functionality access250- **Firebase Integration**: Easy setup251252## Mobile Development Essentials253254### Networking255- **REST APIs**: JSON parsing, error handling256- **GraphQL**: Mobile query language257- **Offline Sync**: Local storage, sync strategies258- **SSL Pinning**: Security259260### Local Data261- **SQLite**: Structured data262- **Key-Value Storage**: SharedPreferences, UserDefaults263- **File System**: Documents, cache directories264265### Authentication266- **OAuth 2.0**: Third-party login267- **JWT**: Token-based auth268- **Biometric**: Face ID, fingerprint269- **Session Management**: Token refresh270271### Testing272- **Unit Tests**: Business logic273- **Widget/Component Tests**: UI testing274- **Integration Tests**: Full app flows275- **UI Automation**: End-to-end testing276277## Deployment278279### iOS2801. Apple Developer Account registration2812. Create certificates and identifiers2823. Build and archive app2834. Submit to App Store2845. Review and approval (1-3 days)285286### Android2871. Google Play Account registration2882. Create signing certificate2893. Build release APK/AAB2904. Upload to Google Play2915. Testing and release (instant)292293### Publishing Best Practices294- App Store Optimization (ASO)295- Beta testing programs296- Update strategy297- Versioning and release notes298299## Projects3003011. **Todo App** - Basic CRUD, storage3022. **Weather App** - API integration, UI3033. **Chat Application** - Real-time, networking3044. **E-commerce App** - Complex UI, payments3055. **Fitness Tracker** - Sensors, data analysis306307## Resources308309### Learning Platforms310- **Udemy**: Framework-specific courses311- **Pluralsight**: In-depth iOS/Android paths312- **Google Codelabs**: Official Android tutorials313- **Apple Developer**: Official iOS resources314315### Documentation316- [Swift.org](https://swift.org/)317- [Android Developers](https://developer.android.com/)318- [React Native](https://reactnative.dev/)319- [Flutter](https://flutter.dev/)320321### Communities322- **Stack Overflow**: Question and answers323- **Reddit**: r/iOSProgramming, r/android, r/flutterdev324- **GitHub**: Open source projects325- **Local Meetups**: Developer communities326327**Roadmap.sh Reference**: https://roadmap.sh/mobile328329---330331**Status**: ✅ Production Ready | **SASMP**: v1.3.0 | **Bonded Agent**: 05-mobile-specialist