An Android application that simulates an IPP (Internet Printing Protocol) printer for testing and quality assurance purposes. This virtual printer can capture print jobs from any network device and provides a user interface to inspect and manage received documents.
- IPP 2.0 Compliance: Full support for standard IPP operations including Print-Job, Get-Printer-Attributes, Create-Job, and Send-Document
- Network Discovery: Automatic printer advertisement via DNS-SD (mDNS/Bonjour)
- Document Processing: Handles multiple document formats (PDF, PostScript, images) with automatic format detection
- Custom Attributes: Support for loading and using custom IPP attribute configurations
- Plugin System: Extensible architecture for custom processing workflows
- Modern UI: Built with Jetpack Compose for a responsive user experience
This application follows Clean Architecture principles with clear separation of concerns:
- Domain Layer: Business logic and entities
- Data Layer: Repositories and data sources
- Presentation Layer: UI components and ViewModels
- Core Layer: Shared utilities and configurations
For detailed architecture information, see ARCHITECTURE.md.
- Android Studio Arctic Fox or later
- Android SDK API 29+ (Android 10+)
- Kotlin 1.9.22+
- Clone the repository
- Open the project in Android Studio
- Sync the project with Gradle files
- Build and run on an Android device or emulator
git clone <repository-url>
cd Printer
./gradlew assembleDebug- Launch the Android Virtual Printer app
- Navigate to the "Printer Service" section
- Tap "Start Printer Service" to begin advertising the virtual printer on the network
- The printer will be discoverable as "Android Virtual Printer" on port 8631
# Add printer using Windows Add Printer wizard
# Use IPP URL: http://[android-device-ip]:8631/ipp/print# Add printer in System Preferences > Printers & Scanners
# Use IPP URL: ipp://[android-device-ip]:8631/ipp/print# Add printer using CUPS web interface or command line
lpadmin -p AndroidVirtualPrinter -E -v ipp://[android-device-ip]:8631/ipp/print -m everywhere# Test Get-Printer-Attributes
curl -X POST -H "Content-Type: application/ipp" \
--data-binary @get-printer-attributes.ipp \
http://[android-device-ip]:8631/ipp/print
# Test with a PDF document
curl -X POST -H "Content-Type: application/ipp" \
--data-binary @print-job-request.ipp \
http://[android-device-ip]:8631/ipp/printThe app supports loading custom IPP attribute configurations:
- Go to Settings > IPP Attributes
- Use "Import Attributes" to load a JSON file with custom printer capabilities
- Supports both legacy array format and modern printer response format
{
"response": {
"operation-attributes": {
"attributes-charset": {"type": "charset", "value": "utf-8"},
"attributes-natural-language": {"type": "naturalLanguage", "value": "en"}
},
"printer-attributes": {
"printer-name": {"type": "name", "value": "Custom Virtual Printer"},
"printer-state": {"type": "enum", "value": 3},
"printer-is-accepting-jobs": {"type": "boolean", "value": true},
"document-format-supported": {
"type": "mimeMediaType",
"value": ["application/pdf", "image/jpeg", "text/plain"]
}
}
}
}Received print jobs are automatically saved to the app's internal storage and can be viewed in the "Print Jobs" section:
- Job Details: View metadata like job ID, submission time, document format, and size
- Document Preview: Open saved documents using the device's default applications
- Export: Share or export captured documents
- LICENSE file has been added to the project root
- All source files include proper copyright headers
- DNS-SD service advertisement working
- Printer discoverable on network via mDNS
- Self-discovery capabilities included
- Test: Use network scanner or printer discovery tools
- IPP Print-Job and Send-Document operations implemented
- Document extraction and format detection working
- Job queue management with plugin hooks
- File storage with organized hierarchy
- Test: Send print jobs from various clients (Windows, macOS, Linux)
- JSON parsing supports both legacy and modern formats
- Robust error handling and validation
- Multi-value attribute support
- Custom attribute validation with flexible strictness levels
- Test: Import various JSON attribute files
# Unit tests
./gradlew test
# Android instrumentation tests
./gradlew connectedAndroidTest
# Lint checks
./gradlew lintFor comprehensive IPP testing, you can use tools like:
- ipptool: Command-line IPP testing tool from CUPS
- Wireshark: Network packet analysis for IPP traffic inspection
- Printer Emulation: Test with various printer driver configurations
Example ipptool test:
ipptool -tv ipp://[android-device-ip]:8631/ipp/print get-printer-attributes.test-
Printer not discoverable:
- Check that both devices are on the same network
- Verify port 8631 is not blocked by firewall
- Ensure mDNS/Bonjour is enabled on the client device
-
Print jobs not received:
- Check Android app logs for IPP request details
- Verify document format is supported
- Ensure sufficient storage space on device
-
Custom attributes not loading:
- Validate JSON format using online JSON validator
- Check app logs for parsing error details
- Ensure required attribute groups are present
Enable verbose logging by setting the log level in the app:
- Go to Settings > Developer Options > Logging Level
- Set to "Debug" or "Verbose" for detailed IPP transaction logs
- Fork the repository
- Create a feature branch
- Make your changes following the established code style
- Add tests for new functionality
- Submit a pull request with a clear description
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Kotlin - Primary language
- Jetpack Compose - Modern UI toolkit
- Ktor - Embedded HTTP/IPP server
- HP JIPP - Java IPP protocol library
- Coroutines - Asynchronous programming
- Android Architecture Components - MVVM and lifecycle management
- IPP Everywhere - IPP standard specification
- CUPS - Common UNIX Printing System
- HP JIPP - Java IPP implementation
For technical details and development guidelines, see ARCHITECTURE.md.