Android Development Process and Tips
Android Development Process
API Development
- Design API request/response (JSON format)
- Design database, POC (Proof of Concept - verify feasibility)
- Define API request/response code
- Write API unit test code
- Create mock data from defined JSON
- Test proper parsing
- Compare with actual API
- Implement API
- Test API
Database Development
- Define Room data model code
- Implement Room unit test code
- Implement Room
- Test Room
ViewModel Development
- Define ViewModel UI data and event method interfaces
- Implement ViewModel unit test code
- Use created API response mock data
- Test business logic
- Test all cases defined in specifications
- Implement ViewModel
- Test ViewModel
UI Development
- Define UI component code (layout, dialog, fragments)
- Implement UI unit test code
- Verify UI displays correctly for each case
- Auto-screenshot for UI inspection per case
- Implement UI (data binding)
- Test UI
Development Tips
General Tips
- Create your own TODO comments: Check for missing parts
- Use Instant Run: Speed up development iteration
- Test with virtual devices: Consistent testing environment
- Avoid test device interference:
- Avoid devices that ask for permission on every install
- Ensure stable connection
UI Layout Tips
- Set Guideline, Barrier, Group first
- Then position UI components according to these guides
This approach creates more maintainable and adaptable layouts.
Collaboration Workflow
Development Order
- API discussion
- Design discussion
- Development
Separation of Concerns
Design
- Verify images are correctly exported
- Verify layout ranges are appropriate
Logic
- Business logic implementation
Server
- Test if API is called correctly
- Write API call tests in app code
Integration
- End-to-end testing
Task Division Benefits
- Reduce duplicate work
- Reduce knowledge requirements for each individual
- Clear responsibility boundaries
Code Review Process
Code reviews are essential for maintaining code quality in Android development. Here is a structured approach:
What to Check During Review
Architecture and Design
- Does the code follow the established architecture (MVVM, Clean Architecture)?
- Are dependencies flowing in the right direction?
- Is business logic in the ViewModel, not in the Activity/Fragment?
Code Quality
- Are variable and function names descriptive and following naming conventions?
- Is there any duplicated code that should be extracted?
- Are there any memory leaks (especially with context references)?
Android-Specific Concerns
- Is the lifecycle handled correctly? (e.g.,
onDestroy, configuration changes) - Are network calls handled on background threads?
- Is the UI thread not blocked by heavy operations?
- Are permissions requested properly?
Testing Strategy
Test Pyramid for Android
| Level | Tools | Speed | Scope |
|---|---|---|---|
| Unit Tests | JUnit, Mockito | Fast | Single function/class |
| Integration Tests | Robolectric | Medium | Multiple components |
| UI Tests | Espresso, Appium | Slow | Full user flows |
Unit Test Coverage Priorities
- ViewModel business logic: This is where most bugs occur
- Repository / data layer: Verify data transformations
- Utility functions: Helper methods used across the app
- Edge cases: Null values, empty lists, boundary conditions
Test Naming Convention
Use descriptive test names that explain the scenario:
@Test
fun `when user clicks login with empty password then show error message`() {
// Arrange
viewModel.setPassword("")
// Act
viewModel.onLoginClicked()
// Assert
assertEquals(LoginError.EMPTY_PASSWORD, viewModel.error.value)
}
Release Checklist
Before each release, go through this checklist:
- All automated tests passing
- Manual regression testing complete
- ProGuard/R8 rules verified with release build
- Version name and code updated
- Release notes prepared
- Crash reporting (Firebase Crashlytics) verified
- Performance profiling done for key screens
- APK/AAB size checked (compare with previous release)
- Deep links tested
- Backward compatibility verified (minimum SDK version)
Comments