Getting Started
Installation and setup guide for Jindong
Getting Started
This guide will help you add Jindong to your Kotlin Multiplatform project.
Module Architecture
Jindong is split into two modules to support different use cases:
| Module | Description | Compose Required |
|---|---|---|
jindong-compose | Declarative DSL with Compose Runtime | Yes |
jindong-core | Core API without Compose dependency | No |
Which Module Should I Use?
- Compose Multiplatform users: Use
jindong-compose(recommended for most users) - Non-Compose projects: Use
jindong-core - Both: Just add
jindong-compose(it includesjindong-coretransitively)
Requirements
Platform Requirements
| Platform | Minimum Version |
|---|---|
| Android | API 26 |
| iOS | iOS 13 |
Project Requirements
- Kotlin 2.0+
- Compose Multiplatform (for
jindong-compose)
Installation
For Compose Multiplatform Projects (Recommended)
Add jindong-compose to your build.gradle.kts:
For Non-Compose Projects
If you don't use Compose Runtime, add jindong-core:
Migration from Previous Version
Breaking Change: The single jindong module has been split into jindong-compose and jindong-core.
Dependency Update
Import Paths
Good news: Import paths remain unchanged for Compose users.
| API | Package | Changed? |
|---|---|---|
| Compose API | io.github.compose.jindong.* | No change |
| Compose DSL | io.github.compose.jindong.dsl.* | No change |
| Core API | io.github.compose.jindong.core.* | New |
Platform Setup
Android
Add the vibration permission to your AndroidManifest.xml:
iOS
No additional setup required. Core Haptics is available on iOS 13+.
Not all iOS devices support haptic feedback. Jindong gracefully handles devices without haptic capabilities.
Basic Setup (Compose)
1. Wrap with JindongProvider
Wrap your app content with JindongProvider to enable haptic feedback:
The provider:
- Creates a platform-specific
HapticExecutor - Makes it available throughout the composition tree
- Handles resource cleanup automatically
2. Use Jindong
Now you can use Jindong anywhere in your composition:
Basic Setup (Core API)
For non-Compose projects, use HapticManager and buildHapticPattern:
See Core API Guide for more details.
Verifying Installation
Create a simple test to verify everything works:
Run on a physical device (haptics don't work on emulators/simulators) and tap the button. You should feel a haptic pulse.
Troubleshooting
No haptic on Android
- Ensure
VIBRATEpermission is declared - Test on a physical device
- Check if device has vibration hardware
No haptic on iOS
- Test on a physical device
- Simulators don't support haptics
- Verify iOS 13+ deployment target
- Some older devices don't have haptic hardware
Compilation errors
- Verify Kotlin version compatibility
- Ensure Compose Runtime is not conflicting with other dependencies
- Check that you're using the correct Gradle configuration
Next Steps
- Quick Start - Build your first haptic pattern
- API Reference - Explore all available APIs
- Composable DSL - Learn the DSL primitives
- Core API Guide - Use haptics without Compose