https://github.com/mattiascibien/kmm-wifi-connect
A Kotlin Multiplatform Mobile (KMM) library designed to simplify Wi-Fi connectivity management across common platforms, targeting Android and iOS. This library provides a unified API connecting to a specific Wi-Fi network. The primary use case is for connecting to hotspots exposed by IoT devices.
https://github.com/mattiascibien/kmm-wifi-connect
compose compose-multiplatform kmm kmm-library kotlin kotlin-android kotlin-library kotlin-multiplatform
Last synced: 3 months ago
JSON representation
A Kotlin Multiplatform Mobile (KMM) library designed to simplify Wi-Fi connectivity management across common platforms, targeting Android and iOS. This library provides a unified API connecting to a specific Wi-Fi network. The primary use case is for connecting to hotspots exposed by IoT devices.
- Host: GitHub
- URL: https://github.com/mattiascibien/kmm-wifi-connect
- Owner: mattiascibien
- License: apache-2.0
- Created: 2025-05-19T14:12:04.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-07-14T13:31:34.000Z (4 months ago)
- Last Synced: 2025-07-14T16:31:24.356Z (4 months ago)
- Topics: compose, compose-multiplatform, kmm, kmm-library, kotlin, kotlin-android, kotlin-library, kotlin-multiplatform
- Language: Kotlin
- Homepage:
- Size: 272 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kmm-wifi-connect

A Kotlin Multiplatform Mobile (KMM) library designed to simplify Wi-Fi connectivity management across common platforms, targeting Android and iOS. This library provides a unified API connecting to a specific Wi-Fi network. The primary use case is for connecting to hotspots exposed by IoT devices.
## Features
* **Cross-Platform Wi-Fi API:** Offers a consistent interface for connecting to Wi-Fi networks in your KMM shared code.
* **Android/iOS Implementation:** Provides a robust implementation, leveraging platform-specific Wi-Fi APIs.
* **Easy Initialization:** On Android it utilizes `androidx.startup` for effortless and efficient initialization on Android.
* **Supports network security:**: Unsecured, WEP (iOS only), WPA2, WPA3
## Installation
Integrate `kmm-wifi-connect` into your KMM project by adding the necessary dependencies to your `build.gradle.kts` files.
### Kotlin Multiplatform Mobile (KMM) Shared Module
In your `composeApp/build.gradle.kts` file (or the `build.gradle.kts` of your KMM shared module), add the dependency to the `commonMain` source set:
```kotlin
// composeApp/build.gradle.kts
kotlin {
[...]
sourceSets {
commonMain.dependencies {
// Replace 'LATEST_VERSION' with the actual latest version of the library
implementation("net.mattiascibien:kmm:wifi-connect:LATEST_VERSION")
}
androidMain.dependencies {
// Replace 'LATEST_VERSION' with the actual latest version of the library
implementation("net.mattiascibien:kmm:wifi-connect-android:LATEST_VERSION")
implementation("androidx.startup:startup-runtime:LATEST_VERSION")
}
}
}
```
### Android configuration
Open your AndroidManifest.xml and add the following code under the `application` node:
```xml
```
## API
The following method can be used to connect to the specified Wi-Fi network.
```kotlin
expect suspend fun connectToWifi(ssid: String, type: WiFiType, password: String? = null) : Boolean
```