mobile-development

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mobile Development Skill

移动开发技能

Production-ready mobile development with modern frameworks, best practices, and mobile-first thinking patterns.
基于现代框架、最佳实践和移动优先思维模式的生产级移动开发指南。

When to Use

适用场景

  • Building mobile applications (iOS, Android, or cross-platform)
  • Implementing mobile-first design and UX patterns
  • Optimizing for mobile constraints (battery, memory, network, small screens)
  • Making native vs cross-platform technology decisions
  • Implementing offline-first architecture and data sync
  • Following platform-specific guidelines (iOS HIG, Material Design)
  • Optimizing mobile app performance and user experience
  • Implementing mobile security and authentication
  • Testing mobile applications (unit, integration, E2E)
  • Deploying to App Store and Google Play
  • 构建移动应用(iOS、Android或跨平台)
  • 实现移动优先设计和UX模式
  • 针对移动设备限制进行优化(电池、内存、网络、小屏幕)
  • 在原生与跨平台技术间做选型决策
  • 实现离线优先架构和数据同步
  • 遵循平台特定指南(iOS HIG、Material Design)
  • 优化移动应用性能和用户体验
  • 实现移动安全与认证功能
  • 测试移动应用(单元测试、集成测试、端到端测试)
  • 部署至App Store和Google Play

Technology Selection Guide

技术选型指南

Cross-Platform Frameworks:
  • React Native: JavaScript expertise, web code sharing, mature ecosystem (121K stars, 67% familiarity)
  • Flutter: Performance-critical apps, complex animations, fastest-growing (170K stars, 46% adoption)
Native Development:
  • iOS (Swift/SwiftUI): Maximum iOS performance, latest features, Apple ecosystem integration
  • Android (Kotlin/Jetpack Compose): Maximum Android performance, Material Design 3, platform optimization
See:
references/mobile-frameworks.md
for detailed framework comparisons
跨平台框架:
  • React Native:具备JavaScript技术栈、支持Web代码共享、生态成熟(121K星标,67%开发者熟悉)
  • Flutter:适用于性能敏感型应用、复杂动画场景、增长速度最快(170K星标,46%采用率)
原生开发:
  • iOS (Swift/SwiftUI):实现iOS平台极致性能、支持最新特性、深度整合Apple生态
  • Android (Kotlin/Jetpack Compose):实现Android平台极致性能、支持Material Design 3、平台针对性优化
详情请见:
references/mobile-frameworks.md
中的框架对比细节

Mobile Development Mindset

移动开发思维模式

The 10 Commandments of Mobile Development:
  1. Performance is Foundation, Not Feature - 70% abandon apps >3s load time
  2. Every Kilobyte, Every Millisecond Matters - Mobile constraints are real
  3. Offline-First by Default - Network is unreliable, design for it
  4. User Context > Developer Environment - Think real-world usage scenarios
  5. Platform Awareness Without Platform Lock-In - Respect platform conventions
  6. Iterate, Don't Perfect - Ship, measure, improve cycle is survival
  7. Security and Accessibility by Design - Not afterthoughts
  8. Test on Real Devices - Simulators lie about performance
  9. Architecture Scales with Complexity - Don't over-engineer simple apps
  10. Continuous Learning is Survival - Mobile landscape evolves rapidly
See:
references/mobile-mindset.md
for thinking patterns and decision frameworks
移动开发十诫:
  1. 性能是基础,而非特性 - 超过3秒加载时间的应用会被70%的用户放弃
  2. 每千字节、每毫秒都至关重要 - 移动设备的限制是真实存在的
  3. 默认采用离线优先设计 - 网络不可靠,需针对性设计
  4. 用户场景优先于开发环境 - 考虑真实世界的使用场景
  5. 了解平台特性但避免平台锁定 - 尊重平台惯例
  6. 快速迭代,而非追求完美 - 发布、衡量、优化的循环是生存之道
  7. 安全与无障碍设计从一开始就融入 - 而非事后补充
  8. 在真实设备上测试 - 模拟器无法反映真实性能
  9. 架构复杂度随项目规模扩展 - 不要对简单应用过度设计
  10. 持续学习是生存必需 - 移动领域发展迅速
详情请见:
references/mobile-mindset.md
中的思维模式和决策框架

Reference Navigation

参考导航

Core Technologies:
  • mobile-frameworks.md
    - React Native, Flutter, Swift, Kotlin, framework comparison matrices, when to use each
  • mobile-ios.md
    - Swift 6, SwiftUI, iOS architecture patterns, HIG, App Store requirements, platform capabilities
  • mobile-android.md
    - Kotlin, Jetpack Compose, Material Design 3, Play Store, Android-specific features
Best Practices & Development Mindset:
  • mobile-best-practices.md
    - Mobile-first design, performance optimization, offline-first architecture, security, testing, accessibility, deployment, analytics
  • mobile-debugging.md
    - Debugging tools, performance profiling, crash analysis, network debugging, platform-specific debugging
  • mobile-mindset.md
    - Thinking patterns, decision frameworks, platform-specific thinking, common pitfalls, debugging strategies
核心技术:
  • mobile-frameworks.md
    - React Native、Flutter、Swift、Kotlin、框架对比矩阵、各框架适用场景
  • mobile-ios.md
    - Swift 6、SwiftUI、iOS架构模式、HIG、App Store要求、平台能力
  • mobile-android.md
    - Kotlin、Jetpack Compose、Material Design 3、Play Store、Android专属特性
最佳实践与开发思维:
  • mobile-best-practices.md
    - 移动优先设计、性能优化、离线优先架构、安全、测试、无障碍设计、部署、数据分析
  • mobile-debugging.md
    - 调试工具、性能分析、崩溃排查、网络调试、平台专属调试方法
  • mobile-mindset.md
    - 思维模式、决策框架、平台特定思维、常见陷阱、调试策略

Key Best Practices (2024-2025)

2024-2025关键最佳实践

Performance Targets:
  • App launch: <2 seconds (70% abandon if >3s)
  • Memory usage: <100MB for typical screens
  • Network requests: Batch and cache aggressively
  • Battery impact: Respect Doze Mode and background restrictions
  • Animation: 60 FPS (16.67ms per frame)
Architecture:
  • MVVM for small-medium apps (clean separation, testable)
  • MVVM + Clean Architecture for large enterprise apps
  • Offline-first with hybrid sync (push + pull)
  • State management: Zustand (React Native), Riverpod 3 (Flutter), StateFlow (Android)
Security (OWASP Mobile Top 10):
  • OAuth 2.0 + JWT + Biometrics for authentication
  • Keychain (iOS) / KeyStore (Android) for sensitive data
  • Certificate pinning for network security
  • Never hardcode credentials or API keys
  • Implement proper session management
Testing Strategy:
  • Unit tests: 70%+ coverage for business logic
  • Integration tests: Critical user flows
  • E2E tests: Detox (React Native), Appium (cross-platform), XCUITest (iOS), Espresso (Android)
  • Real device testing mandatory before release
Deployment:
  • Fastlane for automation across platforms
  • Staged rollouts: Internal → Closed → Open → Production
  • Mandatory: iOS 17 SDK (2024), Android 15 API 35 (Aug 2025)
  • CI/CD saves 20% development time
性能目标:
  • 应用启动时间:<2秒(超过3秒会被70%用户放弃)
  • 内存占用:典型页面<100MB
  • 网络请求:批量处理并积极缓存
  • 电池影响:遵循Doze模式和后台限制
  • 动画:60 FPS(每帧16.67ms)
架构:
  • 中小型应用采用MVVM(清晰解耦、可测试)
  • 大型企业应用采用MVVM+Clean Architecture
  • 离线优先设计搭配混合同步(推送+拉取)
  • 状态管理:Zustand(React Native)、Riverpod 3(Flutter)、StateFlow(Android)
安全(OWASP移动Top 10):
  • 采用OAuth 2.0 + JWT + 生物识别认证
  • 使用Keychain(iOS)/KeyStore(Android)存储敏感数据
  • 网络安全采用证书钉扎
  • 绝不硬编码凭证或API密钥
  • 实现完善的会话管理
测试策略:
  • 单元测试:业务逻辑覆盖率≥70%
  • 集成测试:覆盖关键用户流程
  • 端到端测试:Detox(React Native)、Appium(跨平台)、XCUITest(iOS)、Espresso(Android)
  • 发布前必须进行真实设备测试
部署:
  • 使用Fastlane实现跨平台自动化
  • 分阶段发布:内部测试→封闭测试→公开测试→正式生产
  • 强制要求:iOS 17 SDK(2024)、Android 15 API 35(2025年8月)
  • CI/CD可节省20%开发时间

Quick Decision Matrix

快速决策矩阵

NeedChoose
JavaScript team, web code sharingReact Native
Performance-critical, complex animationsFlutter
Maximum iOS performance, latest featuresSwift/SwiftUI native
Maximum Android performance, Material 3Kotlin/Compose native
Rapid prototypingReact Native + Expo
Desktop + mobileFlutter
Enterprise with JavaScript skillsReact Native
Startup with limited resourcesFlutter or React Native
Gaming or heavy graphicsNative (Swift/Kotlin) or Unity
需求选择方案
拥有JavaScript团队、需要共享Web代码React Native
性能敏感型应用、复杂动画Flutter
iOS平台极致性能、最新特性Swift/SwiftUI原生开发
Android平台极致性能、Material 3Kotlin/Compose原生开发
快速原型开发React Native + Expo
桌面+移动端跨平台Flutter
具备JavaScript技术栈的企业React Native
资源有限的初创公司Flutter或React Native
游戏或重度图形应用原生(Swift/Kotlin)或Unity

Framework Quick Comparison (2024-2025)

2024-2025框架快速对比

CriterionReact NativeFlutterSwift/SwiftUIKotlin/Compose
Stars121K170KN/AN/A
Adoption35%46%iOS onlyAndroid only
Performance80-90% native85-95% native100% native100% native
Dev SpeedFast (hot reload)Very fast (hot reload)Fast (Xcode Previews)Fast (Live Edit)
Learning CurveEasy (JavaScript)Medium (Dart)Medium (Swift)Medium (Kotlin)
UI ParadigmComponent-basedWidget-basedDeclarativeDeclarative
CommunityHuge (npm)GrowingApple ecosystemAndroid ecosystem
Best ForJS teams, web sharingPerformance, animationsiOS-only appsAndroid-only apps
评估维度React NativeFlutterSwift/SwiftUIKotlin/Compose
星标数量121K170KN/AN/A
采用率35%46%仅iOS仅Android
性能80-90%原生水平85-95%原生水平100%原生水平100%原生水平
开发速度快(热重载)极快(热重载)快(Xcode预览)快(实时编辑)
学习曲线简单(JavaScript)中等(Dart)中等(Swift)中等(Kotlin)
UI范式组件化小部件化声明式声明式
社区生态庞大(npm)快速增长Apple生态Android生态
最佳适用场景JS团队、Web代码共享性能要求高、动画复杂仅iOS应用仅Android应用

Implementation Checklist

实施检查清单

Project Setup:
  • Choose framework → Initialize project → Configure dev environment → Setup version control → Configure CI/CD → Team standards
Architecture:
  • Choose pattern (MVVM/Clean) → Setup folders → State management → Navigation → API layer → Error handling → Logging
Core Features:
  • Authentication → Data persistence → API integration → Offline sync → Push notifications → Deep linking → Analytics
UI/UX:
  • Design system → Platform guidelines → Accessibility → Responsive layouts → Dark mode → Localization → Animations
Performance:
  • Image optimization → Lazy loading → Memory profiling → Network optimization → Battery testing → Launch time optimization
Quality:
  • Unit tests (70%+) → Integration tests → E2E tests → Accessibility testing → Performance testing → Security audit
Security:
  • Secure storage → Authentication flow → Network security → Input validation → Session management → Encryption
Deployment:
  • App icons/splash → Screenshots → Store listings → Privacy policy → TestFlight/Internal testing → Staged rollout → Monitoring
项目搭建:
  • 选择框架→初始化项目→配置开发环境→设置版本控制→配置CI/CD→制定团队规范
架构设计:
  • 选择架构模式(MVVM/Clean)→设置目录结构→状态管理→导航→API层→错误处理→日志系统
核心功能:
  • 认证→数据持久化→API集成→离线同步→推送通知→深度链接→数据分析
UI/UX:
  • 设计系统→平台指南→无障碍设计→响应式布局→深色模式→多语言本地化→动画效果
性能优化:
  • 图片优化→懒加载→内存分析→网络优化→电池测试→启动时间优化
质量保障:
  • 单元测试(≥70%覆盖率)→集成测试→端到端测试→无障碍测试→性能测试→安全审计
安全防护:
  • 安全存储→认证流程→网络安全→输入验证→会话管理→加密
部署上线:
  • 应用图标/启动页→截图→商店列表→隐私政策→TestFlight/内部测试→分阶段发布→监控

Platform-Specific Guidelines

平台特定指南

iOS (Human Interface Guidelines):
  • Native navigation patterns (tab bar, navigation bar)
  • iOS design patterns (pull to refresh, swipe actions)
  • San Francisco font, iOS color system
  • Haptic feedback, 3D Touch/Haptic Touch
  • Respect safe areas and notch
Android (Material Design 3):
  • Material navigation (bottom nav, navigation drawer)
  • Floating action buttons, material components
  • Roboto font, Material You dynamic colors
  • Touch feedback (ripple effects)
  • Respect system bars and gestures
iOS(Human Interface Guidelines):
  • 原生导航模式(标签栏、导航栏)
  • iOS设计模式(下拉刷新、滑动操作)
  • San Francisco字体、iOS色彩系统
  • 触觉反馈、3D Touch/Haptic Touch
  • 尊重安全区域和刘海屏
Android(Material Design 3):
  • Material导航(底部导航、导航抽屉)
  • 浮动操作按钮、Material组件
  • Roboto字体、Material You动态色彩
  • 触摸反馈(涟漪效果)
  • 尊重系统栏和手势操作

Common Pitfalls to Avoid

需避免的常见陷阱

  1. Testing only on simulators - Real devices show true performance
  2. Ignoring platform conventions - Users expect platform-specific patterns
  3. No offline handling - Network failures will happen
  4. Poor memory management - Leads to crashes and poor UX
  5. Hardcoded credentials - Security vulnerability
  6. No accessibility - Excludes 15%+ of users
  7. Premature optimization - Optimize based on metrics, not assumptions
  8. Over-engineering - Start simple, scale as needed
  9. Skipping real device testing - Simulators don't show battery/network issues
  10. Not respecting battery - Background processing must be justified
  1. 仅在模拟器上测试 - 真实设备才能反映真实性能
  2. 忽略平台惯例 - 用户期望符合平台特定的交互模式
  3. 未做离线处理 - 网络故障必然会发生
  4. 内存管理不当 - 导致崩溃和糟糕的用户体验
  5. 硬编码凭证 - 存在安全漏洞
  6. 未做无障碍设计 - 排除15%以上的用户群体
  7. 过早优化 - 基于数据指标而非假设进行优化
  8. 过度设计 - 从简单开始,随需求扩展
  9. 跳过真实设备测试 - 模拟器无法体现电池/网络问题
  10. 不考虑电池消耗 - 后台处理必须有合理理由

Performance Budgets

性能预算

Recommended Targets:
  • App size: <50MB initial download, <200MB total
  • Launch time: <2 seconds to interactive
  • Screen load: <1 second for cached data
  • Network request: <3 seconds for API calls
  • Memory: <100MB for typical screens, <200MB peak
  • Battery: <5% drain per hour of active use
  • Frame rate: 60 FPS (16.67ms per frame)
推荐目标:
  • 应用大小:初始下载包<50MB,总大小<200MB
  • 启动时间:<2秒进入可交互状态
  • 页面加载:缓存数据下<1秒
  • 网络请求:API调用<3秒
  • 内存占用:典型页面<100MB,峰值<200MB
  • 电池消耗:活跃使用每小时耗电<5%
  • 帧率:60 FPS(每帧16.67ms)

Resources

资源链接