Release v0.2.0 🎉
We are excited to announce the release of PlatformTools v0.2.0, featuring significant improvements, new functionalities, and the introduction of an entirely new module! Below is a summary of the latest additions and modifications.
🚀 What's New in v0.2.0
🌐 Core Module
New Feature: getPlatform
The Core
module now includes the getPlatform
function, which allows you to determine the specific platform or runtime environment where the application is running. This addition complements the existing getOperatingSystem
function and provides even more flexibility for platform-specific logic.
fun getPlatform(): Platform
🔧 AppManager Module
Modification: WindowsConfig
Renamed to WindowsInstallerConfig
The configuration class for managing Windows application installations has been renamed for better clarity and consistency. Update your references accordingly:
WindowsInstallerConfig.requireAdmin = false
New Features:
-
hasAppVersionChanged
: Detect if the application version has changed since the last time it was opened. Useful for update-related actions.fun hasAppVersionChanged(): Boolean
-
isFirstInstallation
: Check if it is the first installation of the app. Ideal for onboarding or initial setup.fun isFirstInstallation(): Boolean
📥 ReleaseFetcher Module
New Feature: ReleaseFetcherConfig
The ReleaseFetcher
module now includes ReleaseFetcherConfig
, a configurable object that allows you to fine-tune download buffer sizes and client timeouts for optimized performance:
ReleaseFetcherConfig.downloaderBufferSize = 4 * 1024 * 1024 // Set buffer size to 4 MB
ReleaseFetcherConfig.clientTimeOut = 60_000 // Set timeout to 60 seconds
🆕 Permission Handler Module
The Permission Handler module is a brand-new addition to the library, simplifying the process of checking and requesting permissions on Android.
Key Features:
-
Comprehensive Permission Support:
- Install Permissions
- Notifications
- Location (Coarse, Fine, Background)
- Bluetooth
- Camera
- Audio Recording
- Overlay
- Contacts (Read/Write)
- External Storage (with Android 13+ specific media permissions)
-
Ease of Use: Minimal setup and clear APIs for checking and requesting permissions with simple callbacks for granted or denied states.
Example:
fun checkAndRequestInstallPermission() {
if (hasInstallPermission()) {
println("Install permission already granted.")
} else {
requestInstallPermission(
onGranted = {
println("Install permission granted.")
},
onDenied = {
println("Install permission denied.")
}
)
}
}
📦 Dependency Updates
To include these features in your project, update your dependencies in build.gradle.kts
:
- Core Module:
implementation("io.github.kdroidfilter:platformtools.core:0.2.0")
- AppManager Module:
implementation("io.github.kdroidfilter:platformtools.appmanager:0.2.0")
- ReleaseFetcher Module:
implementation("io.github.kdroidfilter:platformtools.releasefetcher:0.2.0")
- Permission Handler Module:
implementation("io.github.kdroidfilter:platformtools.permissionhandler:0.2.0")
🛠️ Upgrading Notes
- Update any references from
WindowsConfig
toWindowsInstallerConfig
. - Leverage new utility functions such as
hasAppVersionChanged
,isFirstInstallation
, andgetPlatform
for enhanced functionality. - Explore the new
Permission Handler
module for Android-specific permission handling. - Use
ReleaseFetcherConfig
to customize download configurations in theReleaseFetcher
module.
Thank you for using PlatformTools!
- 0.2.0 by @kdroidFilter in #2
Full Changelog: v0.1.4...v0.2.0