Getting Started
Set Up Development Environment
Ensure you have the following installed:
- Android Studio (latest stable version)
- JDK 11 or higher
- Kotlin 1.9.23
- Android SDK 31+
Project Structure
Understanding the project structure will help you navigate and contribute effectively.
Development Guidelines
Architecture
MVVM Pattern
Follow the Model-View-ViewModel architecture pattern used throughout the project.
Repository Pattern
Use the Repository pattern for data access. All database operations go through repositories.
Jetpack Compose
Build UI with Compose. Avoid mixing XML layouts with Compose.
Room Database
Use Room for data persistence. Update schema version when modifying entities.
Code Style
Kotlin Conventions
Kotlin Conventions
- Follow Kotlin coding conventions
- Use meaningful variable and function names in Spanish or English consistently
- Add KDoc comments for public APIs and complex logic
- Prefer immutability: use
valovervarwhen possible
Compose Best Practices
Compose Best Practices
- Keep composables small and focused
- Hoist state when necessary
- Use
rememberandrememberSaveableappropriately - Pass callbacks for events, not ViewModels
ViewModels
ViewModels
- ViewModels should NOT access Android resources directly (
R.string,Context, etc.) - Use dependency injection or pass necessary data from UI layer
- Expose UI state via
StateFloworState
Testing Requirements
All new features and bug fixes should include appropriate tests.
Unit Tests
Located inapp/src/test/, unit tests verify business logic without Android dependencies.
Technologies:
JUnit- Test frameworkMockK- Mocking libraryTurbine- Flow testingkotlinx-coroutines-test- Coroutine testing
Instrumented Tests
Located inapp/src/androidTest/, these tests run on Android devices or emulators.
Technologies:
Compose Test Rule- UI testing for ComposeEspresso- Android UI testingJUnit- Test framework
Internationalization
MiTensión supports three languages:Spanish (default)
res/values/strings.xmlEnglish
res/values-en/strings.xmlGalician
res/values-gl/strings.xml- Add the string to
values/strings.xml(Spanish) - Add English translation to
values-en/strings.xml - Add Galician translation to
values-gl/strings.xml
Submitting Changes
Pull Request Process
Make Changes
- Write clean, well-documented code
- Follow the architecture patterns
- Add tests for new functionality
- Update documentation if needed
PR Checklist
Before submitting your pull request, ensure:- Code follows project conventions and style
- All tests pass (unit and instrumented)
- New features include appropriate tests
- All new strings are translated to Spanish, English, and Galician
- No Android resources (
R.string, etc.) accessed directly in ViewModels - Documentation is updated if needed
- Commit messages are clear and descriptive
Reporting Issues
Bug Reports
When reporting bugs, include:
- Device and Android version
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
Feature Requests
For feature requests, describe:
- The problem it solves
- Proposed solution
- Any alternative approaches
Code Review
All submissions require review. We use GitHub pull requests for this purpose. Reviewers will check:- Code quality and adherence to conventions
- Test coverage
- Architecture compliance
- Internationalization completeness
- Performance implications
Be open to feedback and willing to make changes. Code review helps maintain code quality and knowledge sharing.
Questions?
If you have questions about contributing, feel free to:- Open a GitHub issue with the “question” label
- Review existing documentation
- Check closed issues for similar questions