A .NET MAUI cross-platform client application for interacting with the DivisiBill Web Service. This mobile/desktop application provides a comprehensive user interface for managing file storage, billing, items, and table data through a web-based API.
DivisiBillWsClient is built with Microsoft .NET MAUI (Multi-platform App UI) and targets both Android and Windows platforms. It enables users to connect to a DivisiBill Web Service instance and perform operations including file management, billing operations, inventory tracking, and database table operations. It also permits a connection to Azure Data storage to directly access and manage stored items.
-
App.xaml / App.xaml.cs - Application entry point and initialization
- Configures the main application window (800x800)
- Stores global settings including the user API key
- Manages application-level state through
SettingsClass
-
AppShell.xaml / AppShell.xaml.cs - Shell navigation container
- Defines the tab-based navigation structure
- Routes between different pages
- Displays dynamic title bar
-
MauiProgram.cs - MAUI configuration
- Initializes the MAUI app with platform-specific configurations
- Registers MAUI Community Toolkit services
- Configures custom fonts (OpenSans)
The application uses a tabbed interface with five main pages:
- Purpose: Basic Web Service configuration and connection testing
- Features:
- Base URL picker with predefined options or custom URL entry
- Web service version and status checking
- Cloud authentication setup (password management)
- Response display for API calls
- ViewModel:
MainPageViewModel
- Purpose: File upload, download, and activity tracking
- Features:
- View file activity history
- Manage remote file operations
- ViewModel:
MainPageViewModel
- Purpose: Inventory and stored items management
- Features:
- Browse stored items on the server
- Track item metadata
- ViewModel:
MainPageViewModel
- Purpose: Billing and in-app purchase management
- Features:
- View billing information
- Manage subscriptions and purchases
- ViewModel:
BillingPageViewModel
- Purpose: Database table operations
- Features:
- Access remote database tables
- View and manage table data
- ViewModel:
TablePageViewModel
- ChangePasswordPopup (
Views/ChangePasswordPopup.xaml) - Modal popup for password management- Used by the Call Status page for cloud authentication setup
- ViewModel:
ChangePasswordViewModel
All ViewModels inherit from ObservableObject and use the MVVM Toolkit for property change notifications and command binding.
-
MainPageViewModel.cs (918 lines)
- Central view model handling most application logic, it should really be 3 view models, one each for the 3 main pages, but for now it is all in one.
- Manages web service communication via shared
HttpClient - Properties:
BaseUrl/BaseUrlText- Web service endpoint configurationBaseUrlChoices- Pre-configured service URLsStatusResponse- Display responses from API callsHasPassword- Cloud authentication state
- Commands:
CallVersionCommand- Fetch service versionCallStatusCommand- Check service statusChangePasswordCommand- Update user passwordClearStatusResponseCommand- Clear response display
- Methods:
OnLoadedAsync()- Page initialization- File operations (upload, download, delete)
- Remote item management
-
BillingPageViewModel.cs
- Handles billing-related operations and in-app purchases
- Manages purchase validation and subscription state
-
ChangePasswordViewModel.cs
- Manages password change dialog logic
- Validates and commits password changes
-
TablePageViewModel.cs
- Manages database table operations
- Handles table data retrieval and updates
-
CallWs.cs - Web service communication layer
- Handles HTTP requests to the DivisiBill Web Service
- Provides methods for API operations
-
CryptManager.cs - Cryptographic operations
- Manages encryption/decryption for sensitive data
- Password hashing and verification
-
Billing.cs - Billing service integration
- Manages in-app purchase operations
- Handles subscription state
-
Utilities.cs - Helper utilities
- Common utility functions used across the application
-
CrossInAppBilling.shared.cs - Cross-platform billing abstraction
- Provides platform-agnostic in-app billing interface
-
BillingItem.cs - Data model for billing information
- Represents a billable item or invoice
-
PriceItem.cs - Data model for pricing
- Represents pricing information
-
AndroidPurchase.cs - Android-specific purchase model
- Handles Android in-app purchase details
- EnvironmentToStringConverter.cs - XAML value converter
- Converts environment variables or state objects to display strings
- Used in bindings for conditional UI display
- AppIcon - Application branding assets
- Splash - Splash screen displayed on startup
- Images - UI graphics and images
- Fonts - Custom fonts (OpenSans-Regular.ttf)
- Styles - XAML style definitions
Platform-specific code for Android and Windows implementations:
- Android-specific manifest configurations
- Windows-specific package definitions
AppShell (TabBar)
├── Status Tab
│ └── CallStatusPage
├── Files Tab
│ └── FileActivitiesPage
├── Items Tab
│ └── StoredItemsPage
├── Billing Tab
│ └── BillingPage
└── Tables Tab
└── TablePage
The application uses the MVVM pattern with unidirectional data flow:
View (XAML)
↓
Data Binding
↓
ViewModel (ObservableObject with Commands)
↓
Services (HttpClient, CryptManager, etc.)
↓
Web Service / Local Storage
- Configurable Base URL - Connect to different DivisiBill instances
- API Key Management - Store and manage authentication credentials
- HTTP Client Pooling - Shared
HttpClientfor efficient resource usage - Version Checking - Verify service availability and version
- Password Management - Set or change cloud authentication passwords
- Secure Credential Storage - Uses encryption for sensitive data
- API Key Support - Environment-based key configuration for multiple deployments
- File upload and download capabilities
- Activity tracking for file operations
- Remote file deletion
- Android in-app purchase integration
- Subscription management
- Purchase validation and history
- Android: Native purchase implementation, device integration
- Windows: Desktop application with touch/keyboard input support
The application provides multiple ways to configure the web service URL:
- Built-in Production URL - From
Generated.BuildInfo.DivisiBillWsUri - Environment Variables:
DIVISIBILL_WS_URI_RELEASE- Production deploymentDIVISIBILL_ALTERNATE_WS_URI- Alternate service instance
- Manual Entry - Users can enter custom URLs via the UI
API keys are automatically selected based on the configured base URL:
- Production URL uses production key from build info
- Environment variable URLs use corresponding environment keys
- Manual URLs require users to provide credentials
net10.0-android- Android applicationnet10.0-windows10.0.19041.0- Windows desktop application (when building on Windows)
- Language Version: Preview (Latest C# features)
- Nullable Reference Types: Enabled
- XAML Compilation: With source compilation binding support
- Unsafe Blocks: Enabled for interop scenarios
- Material Design 3: Enabled for modern UI styling
- Display Name: DivisiBillWsClient
- Package ID: com.autoplus.divisibill
- Version: 1.0
- .NET MAUI (Microsoft.Maui.*)
- MVVM Community Toolkit (CommunityToolkit.Mvvm)
- MAUI Community Toolkit (CommunityToolkit.Maui)
- HTTP/JSON communication (.NET System.Net.Http.Json)
- Cryptography (.NET System.Security.Cryptography)
- File operations and storage access
- In-app billing integration
- Uses
ObservableObjectbase class for automatic property change notifications - Implements
IRelayCommandfor command binding - Supports property change notifications with
[NotifyPropertyChangedFor]attributes
- Platform-specific code in
Platforms/directory - Conditional compilation for Android/Windows differences
- Abstract services for cross-platform functionality
SettingsClassinApp.csmaintains application settingsUserKeyproperty stores API credentials- Settings persist across application sessions
- Credentials stored in
SettingsClassshould be treated as sensitive - API keys should be protected in configuration/environment variables
- HTTPS is recommended for all web service communication
- Cryptographic operations use standard .NET cryptography APIs
The architecture supports easy addition of new features:
- New Pages: Add XAML page + code-behind + ViewModel
- New Services: Add service class with dependency injection
- New Models: Add data model class in Models/
- Platform Features: Add platform-specific code in Platforms/
Refer to the root repository LICENSE.txt file.