Building mobile apps usually means choosing between two paths: maintaining separate native codebases or sacrificing platform-specific experiences with a fully shared solution.
For my latest side project, I wanted to explore whether Kotlin Multiplatform could help me build something more complex than a typical CRUD app — a custom keyboard for both Android and iOS.
The result is Prompt AI Keyboard: a keyboard that helps users create better prompts for AI tools like ChatGPT, Claude, Gemini, Midjourney, and GitHub Copilot.
The idea
AI tools are powerful, but the quality of the output often depends on how well the prompt is written.
I noticed that I was constantly rewriting my prompts:
- Adding more context
- Explaining the desired format
- Clarifying the goal
- Making instructions more structured
The process usually looked like this:
- Write a rough idea
- Copy it to a prompt enhancer
- Rewrite it manually
- Copy the improved prompt back
I wanted to remove that friction and make prompt improvement available directly where people already type.
Architecture overview
The main challenge was building a keyboard that works naturally on both platforms while sharing as much code as possible.
The architecture consists of:
- Kotlin Multiplatform shared module
- Native keyboard extensions for Android and iOS
- Firebase Cloud Functions backend
- Gemini API integration
- In-app purchase verification and usage tracking
The shared KMP layer handles:
- Prompt processing logic
- AI request preparation
- Data models
- Business rules
- Network communication
Platform-specific code handles:
- Keyboard UI
- Input handling
- System keyboard APIs
- Platform lifecycle management
Why Kotlin Multiplatform?
For a project like this, I wanted:
- One shared business logic layer
- Less duplicated code
- Native UI and platform integration
- The ability to iterate quickly on both platforms
KMP provided a good balance between code sharing and native capabilities.
Unlike a fully shared UI approach, the keyboard interface remains native because both Android and iOS have very different keyboard extension APIs and user expectations.
Challenges of building a keyboard
A keyboard is not just another mobile screen.
Some challenges I encountered:
1. Limited resources
Keyboard extensions have stricter limitations than regular applications.
Every operation needs to be lightweight because the keyboard must feel instant.
2. Platform differences
Android and iOS handle keyboards very differently.
Things like:
- Text insertion
- Keyboard lifecycle
- Permissions
- Background execution
- UI constraints
required platform-specific solutions.
3. Latency
AI features introduce network delays.
The challenge was making the experience feel fast:
- Optimizing request payloads
- Keeping UI responsive
- Handling failures gracefully
- Providing useful feedback during generation
What I learned
Building this project reinforced that Kotlin Multiplatform is not only useful for sharing simple models or utilities.
It can also support more complex products where:
- Business logic is shared
- Platform integration remains native
- User experience is still tailored to each ecosystem
The biggest lesson: the hardest part of building a mobile product is often not the code itself, but understanding platform limitations and designing around them.
What's next?
I'm continuing to improve Prompt AI Keyboard and explore new ways AI can assist users directly inside everyday workflows.
Some ideas I'm exploring:
- More AI-powered writing actions
- Better customization per AI model
- Offline capabilities for certain features
- More integrations
I'd love to hear feedback from developers:
- Have you built custom keyboards before?
- Would you choose Kotlin Multiplatform for this type of project?
- What AI features would you find useful directly inside a keyboard?
Thanks for reading!

Top comments (0)