InfiXOX — Full Android Game Source Code (Kotlin + Jetpack Compose + AdMob)
InfiXOX
Complete Android Game Source Code -- Infinite Tic-Tac-Toe with AI Opponent
2,555 lines of Kotlin / 23 files / Published on Google Play
Get Source CodeView on Google Play Store
InfiXOX is a modern twist on Tic-Tac-Toe with one game-changing rule: each player can only have 3 pieces on the board at a time. When you place your 4th piece, your oldest one vanishes. No more draws. Every game has a winner.
This is the complete source code for the app that's currently live on the Google Play Store. Production-ready, clean architecture, fully documented. Buy it, customize it, publish it as your own.
What Makes This Different
Max 3 pieces per player. Oldest piece vanishes when you place #4. Eliminates all draws -- every game ends with a winner.
Smart opponent with fork detection, center control, and strategic corner play. Not random -- actually challenging to beat.
100% Compose with Material 3 dark theme, animated confetti, splash screen animations, and smooth transitions.
Full Google AdMob integration with test IDs for debug and production IDs for release. Just swap your ad unit IDs.
Tech Stack
Project Structure
MainActivity.kt // Navigation: Splash > Menu > Game
game/
GameLogic.kt // Win detection, draw logic
AIStrategy.kt // 7-tier AI decision tree
model/
GameModels.kt // Data classes: CellState, Move, GameState
viewmodel/
GameViewModel.kt // MVVM state management (StateFlow)
sound/
SoundManager.kt // SoundPool + SharedPreferences
ui/screens/
SplashScreen.kt // Animated intro
MainMenuScreen.kt // Solo / Local Duel selection
GameScreen.kt // Main game UI container
AdBanner.kt // AdMob banner component
ui/components/
GameBoard.kt // 3x3 grid with tap handling
ScoreBoard.kt // Player scores display
Confetti.kt // Victory celebration effect
+ 6 more components...
ui/theme/
Color.kt, Theme.kt, Type.kt // Material 3 theming
res/raw/
cell_tap.wav, winning.wav, game_over.wav
What You Get
| Source Code | 23 Kotlin files, 2,555 lines of clean, readable code |
| Architecture | MVVM with StateFlow -- proper separation of concerns |
| Game Modes | Solo (vs 7-level AI) + Local Duel (2-player PvP) |
| Match System | Best of 5 rounds with score tracking |
| UI/UX | Material 3 dark theme, animations, confetti, sound effects |
| Monetization | AdMob banner ads with debug/release build configurations |
| Sound Effects | 3 WAV files (tap, win, game over) with toggle preference |
| Assets | App icon (all densities), vectors, gradients, logo |
| Build Config | Gradle KTS with version catalog, release signing ready |
| Play Store Proof | Currently live at com.jeripurnama.infixox |
build.gradle.kts with your own AdMob IDs, build a release APK, and publish. Your own monetized game in under an hour.
Who Should Buy This
- Android developers learning Jetpack Compose -- a complete, real-world Compose app to study and extend. Better than any tutorial.
- Indie developers who want to publish fast -- reskin the theme, change the app name, swap AdMob IDs, publish on Play Store. Done.
- Students building a portfolio -- understand MVVM, StateFlow, Coroutines, and game AI through working production code.
- Anyone who wants passive income from apps -- the AdMob integration is already built. Publish and let banner ads generate revenue.
AI Strategy Deep Dive
The AI opponent uses a 7-tier priority decision tree, not random moves. Here's how it thinks:
| Priority 1 | Win immediately if a winning move is available |
| Priority 2 | Block player's win -- don't let the player complete a line |
| Priority 3 | Create a fork -- set up 2+ ways to win simultaneously |
| Priority 4 | Block player's fork -- prevent the player from creating forks |
| Priority 5 | Take center -- strongest strategic position |
| Priority 6 | Take opposite corner -- counter the player's corner |
| Priority 7 | Random available cell -- fallback when no strategic move exists |
Combined with the infinite pieces mechanic (where old pieces vanish), this creates a constantly shifting board where the AI genuinely challenges you. It's not tic-tac-toe as you know it.
How to Customize
| Change colors | Edit Color.kt -- all colors in one file (Material 3 theme) |
| Swap AdMob IDs | Edit build.gradle.kts -- replace manifestPlaceholders values |
| Change app name | Edit strings.xml -- all 80+ strings in one file |
| Add difficulty levels | Modify AIStrategy.kt -- skip priorities for easier AI |
| Add new game modes | Extend GameViewModel.kt -- the state management is modular |
| Change board size | Modify GameConstants -- designed to be adjustable |
| Add interstitial ads | Follow the same pattern as AdBanner.kt |
| Publish to Play Store | Generate your keystore, update build.gradle.kts, build release APK |
Frequently Asked Questions
Can I publish this on the Play Store?
Yes. Change the package name, app name, colors, and AdMob IDs. It becomes your app. Many buyers do exactly this.
Do I need to credit the original developer?
No. This is a full source code license. You can use it commercially, modify it, and publish it under your own name.
What Android Studio version do I need?
Android Studio Hedgehog or newer. The project uses Gradle KTS with version catalogs (modern setup).
Is the AdMob integration production-ready?
Yes. Debug builds automatically use Google's test ad IDs (prevents policy violations during development). Release builds use your production IDs. Just swap the IDs in the build config.
Can I add more features?
Absolutely. The MVVM architecture makes it straightforward to add online multiplayer, leaderboards, different board sizes, or in-app purchases. The code is clean and well-structured for extension.
What if I get stuck?
Drop a comment below or reach out. I built this app and I'm happy to help with setup or customization questions.
Get InfiXOX Source Code
2,555 lines of production Kotlin. Jetpack Compose + Material 3 + MVVM + AdMob. Published on Play Store.
Download for $14Have questions before buying? Drop a comment below -- I respond to every one.
No comments: