Choose a character 🐶🐱 and Gemini AI will generate a bedtime story for you.
StoryTeller-Showcase.mp4
To setup the environment, please consult these instructions.
- Get a Gemini API Key
- Add to
local.propertiesfile located in the root directory (create if it doesn't exist):gemini.api_key=YOUR_KEY
Open project in IntelliJ IDEA or Android Studio and run composeApp configuration.
Open project in IntelliJ IDEA or Android Studio and run iosApp configuration.
Or open iosApp/iosApp.xcodeproj in Xcode and run it.
The app uses the following multiplatform dependencies in its implementation:
- Compose Multiplatform for UI
- Ktor for networking with Gemini API
- kotlinx.serialization for JSON handling
- Compose ViewModel to store and manage UI-related data
- gradle-buildconfig-plugin to expose the Gemini API Key as a constant from
local.properties - Compose Navigation for navigation between screens
To synthesize speech from the story text, it uses:
- TextToSpeech for Android
- AVSpeechSynthesizer for iOS
If you want the AI to generate other type of stories or make them longer, you can modify the prompt by opening the strings.xml files. You'll find one prompt string per language.
Open CharacterRepository and modify getAllCharacters(): Add the character you desire by providing a name, emoji and a background color.
You have to declare the name in the strings.xml files. You'll find one name string per language.
