First off, thank you for considering contributing to this project! 🎉
It's people like you that make this project such a great tool for the community.
There are many ways you can contribute to this project:
- 🐛 Report bugs - Found a bug? Let us know!
- 💡 Suggest features - Have an idea? We'd love to hear it!
- 📝 Improve documentation - Help others understand the project better
- 🎨 Improve UI/UX - Make the app more beautiful and user-friendly
- 🔧 Fix issues - Pick an issue and submit a PR
- 🚀 Add new features - Bring new capabilities to the app
- 📖 Write tutorials - Help others learn from your experience
Before you begin, ensure you have:
- Android Studio Arctic Fox or newer
- JDK 11 or higher
- Git installed on your machine
- Basic knowledge of Android development and PyTorch
-
Fork the repository
Click the "Fork" button at the top right of this page.
-
Clone your fork
git clone https://github.com/YOUR-USERNAME/Pytorch-Android-Mobile-Application.git cd Pytorch-Android-Mobile-Application -
Add upstream remote
git remote add upstream https://github.com/umitkacar/Pytorch-Android-Mobile-Application.git
-
Download the model
Download
model.ptfrom Google Drive and place it in:HelloWorldApp/app/src/main/assets/model.pt -
Open in Android Studio
Open the
HelloWorldAppdirectory in Android Studio and let Gradle sync.
Always create a new branch for your work:
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fixUse descriptive branch names:
feature/camera-capturefor new featuresfix/memory-leakfor bug fixesdocs/api-documentationfor documentationrefactor/optimize-inferencefor refactoring
- Write clean, readable code
- Follow the existing code style
- Add comments where necessary
- Update documentation if needed
Before submitting:
- ✅ Build the project successfully
- ✅ Test on physical device or emulator
- ✅ Verify existing features still work
- ✅ Test edge cases
- ✅ Check for memory leaks
Write clear, descriptive commit messages:
git add .
git commit -m "feat: add camera capture functionality"Commit Message Format:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding testschore:- Maintenance tasks
git push origin feature/your-feature-name- Go to your fork on GitHub
- Click "Compare & pull request"
- Fill out the PR template
- Link any related issues
- Submit the PR
- Use 4 spaces for indentation (not tabs)
- Follow Google Java Style Guide
- Use meaningful variable and method names
- Keep methods short and focused
- Add JavaDoc comments for public methods
Example:
/**
* Preprocesses the image for model inference.
*
* @param bitmap The input image bitmap
* @return Preprocessed tensor ready for inference
*/
private Tensor preprocessImage(Bitmap bitmap) {
Bitmap resized = Bitmap.createScaledBitmap(bitmap, 320, 320, false);
return TensorImageUtils.bitmapToFloat32Tensor(
resized,
TensorImageUtils.TORCHVISION_NORM_MEAN_RGB,
TensorImageUtils.TORCHVISION_NORM_STD_RGB
);
}- Use meaningful IDs
- Follow Material Design guidelines
- Use ConstraintLayout for complex layouts
- Keep layouts simple and flat
When filing a bug report, please include:
- Description - Clear description of the bug
- Steps to reproduce - Detailed steps to reproduce the issue
- Expected behavior - What you expected to happen
- Actual behavior - What actually happened
- Screenshots - If applicable
- Environment:
- Device model
- Android version
- App version
- Logs - Relevant logcat output
When suggesting a feature:
- Clear title - Descriptive title for the feature
- Problem statement - What problem does it solve?
- Proposed solution - How should it work?
- Alternatives - Any alternative solutions considered?
- Additional context - Screenshots, mockups, examples
- Update README.md if you change functionality
- Add JavaDoc comments to new public methods
- Update inline comments if you change logic
- Create tutorials for complex features
All submissions require review:
- Automated checks - Must pass CI/CD checks
- Code review - Maintainer reviews your code
- Testing - Maintainer tests the changes
- Approval - PR is approved and merged
What reviewers look for:
- Code quality and style
- Proper testing
- Documentation
- No breaking changes
- Performance implications
Contributors will be:
- Listed in the README
- Mentioned in release notes
- Part of the project's success story!
Need help? Here's how to reach out:
- 💬 GitHub Discussions - Ask questions and discuss ideas
- 🐛 GitHub Issues - Report bugs and request features
- 📧 Email - Contact the maintainer directly
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
By contributing, you agree that your contributions will be licensed under the MIT License.
Your contributions make this project better for everyone. We appreciate your time and effort!
Happy Coding! 🚀