android-development

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Android Development Guidelines

Android开发指南

Kotlin and Jetpack Compose Fundamentals

Kotlin与Jetpack Compose基础

  • Use Kotlin 1.9+ with modern language features
  • Prefer Jetpack Compose for new UI components
  • Use Compose state management (@State, @Remember, @ViewModel)
  • Leverage Kotlin Coroutines for asynchronous operations
  • Use Kotlin Flow for reactive streams
  • Follow Kotlin coding conventions
  • 使用带有现代语言特性的Kotlin 1.9+
  • 优先为新UI组件使用Jetpack Compose
  • 使用Compose状态管理(@State、@Remember、@ViewModel)
  • 利用Kotlin Coroutines处理异步操作
  • 使用Kotlin Flow实现响应式流
  • 遵循Kotlin编码规范

Android Architecture Patterns

Android架构模式

  • MVVM: Use with ViewModel and LiveData/StateFlow
  • Clean Architecture: Separate data, domain, and presentation layers
  • Repository Pattern: Abstract data sources
  • Implement dependency injection with Hilt
  • Separate business logic from UI code
  • Use interfaces for abstraction and testing
  • MVVM:结合ViewModel与LiveData/StateFlow使用
  • Clean Architecture:分离数据层、领域层与表示层
  • Repository Pattern:抽象数据源
  • 使用Hilt实现依赖注入
  • 将业务逻辑与UI代码分离
  • 使用接口实现抽象与测试

Android Jetpack Libraries

Android Jetpack库

  • Room: Use for local database persistence
  • WorkManager: Use for background tasks
  • Navigation Component: Use for app navigation
  • DataStore: Use for key-value storage
  • Paging 3: Use for paginated data
  • CameraX: Use for camera functionality
  • BiometricPrompt: Use for biometric authentication
  • AppCompat: Use for backward compatibility
  • Room:用于本地数据库持久化
  • WorkManager:用于后台任务
  • Navigation Component:用于应用导航
  • DataStore:用于键值存储
  • Paging 3:用于分页数据处理
  • CameraX:用于相机功能
  • BiometricPrompt:用于生物识别认证
  • AppCompat:用于向后兼容

Material Design 3 Guidelines

Material Design 3指南

  • Follow Material Design 3 principles
  • Use Material 3 components and theming
  • Implement proper elevation and shadows
  • Use Material Icons for consistency
  • Support different screen sizes and densities
  • Implement responsive layouts
  • Support Dark Theme properly
  • Use motion and animations appropriately
  • 遵循Material Design 3原则
  • 使用Material 3组件与主题
  • 实现恰当的层级与阴影
  • 使用Material Icons保持一致性
  • 支持不同屏幕尺寸与密度
  • 实现响应式布局
  • 妥善支持深色主题
  • 合理使用动效与动画

Android Permissions and Security

Android权限与安全

  • Request runtime permissions properly
  • Use permission best practices
  • Implement proper certificate pinning
  • Use Android Keystore for secure storage
  • Follow security best practices
  • Implement proper network security configuration
  • Use ProGuard/R8 for code obfuscation
  • 正确请求运行时权限
  • 遵循权限最佳实践
  • 实现恰当的证书固定
  • 使用Android Keystore进行安全存储
  • 遵循安全最佳实践
  • 配置恰当的网络安全策略
  • 使用ProGuard/R8进行代码混淆

Google Play Store Submission

Google Play商店提交

  • Follow Google Play Developer Policies
  • Prepare app bundle (AAB) for upload
  • Prepare screenshots and store listing
  • Test with Internal and Closed Testing tracks
  • Handle app updates and versioning properly
  • Comply with privacy and data collection policies
  • Use Play Console for distribution and analytics
  • 遵循Google Play开发者政策
  • 准备用于上传的应用包(AAB)
  • 准备截图与商店列表
  • 通过内部测试与封闭测试轨道进行测试
  • 妥善处理应用更新与版本控制
  • 遵守隐私与数据收集政策
  • 使用Play Console进行分发与分析

Android Performance Optimization

Android性能优化

  • Use Android Profiler for performance analysis
  • Optimize APK/AAB size with code shrinking
  • Use leak detection tools (LeakCanary)
  • Implement proper image loading and caching
  • Optimize network requests and data transfer
  • Reduce app startup time
  • Use efficient layouts and view binding
  • Optimize battery usage
  • 使用Android Profiler进行性能分析
  • 通过代码缩减优化APK/AAB大小
  • 使用内存泄漏检测工具(LeakCanary)
  • 实现恰当的图片加载与缓存
  • 优化网络请求与数据传输
  • 缩短应用启动时间
  • 使用高效布局与视图绑定
  • 优化电池使用

Android Testing Frameworks

Android测试框架

  • JUnit: Use for unit tests
  • Espresso: Use for UI tests
  • Compose Testing: Use for Compose UI tests
  • Robolectric: Use for local unit tests
  • MockK: Use for mocking in tests
  • Truth: Use for assertion libraries
  • Write testable code with dependency injection
  • JUnit:用于单元测试
  • Espresso:用于UI测试
  • Compose Testing:用于Compose UI测试
  • Robolectric:用于本地单元测试
  • MockK:用于测试中的模拟
  • Truth:用于断言库
  • 通过依赖注入编写可测试代码