Get the Android app running in 5 minutes!
This guide gets you from zero to a running Android app as fast as possible.
cd /Users/brendonsmith/exp/XRAiAssistant/XRAiAssistantAndroid
open -a "Android Studio" .Wait for:
- ✅ Gradle sync to complete
- ✅ Dependencies to download (~200MB)
- ✅ Indexing to finish
In Android Studio:
- Click Build → Make Project (or
⌘ + F9) - Wait for build to succeed
- Check no errors in Build panel
-
Connect Android device OR launch emulator
- Physical device: Enable USB debugging
- Emulator: Use AVD Manager (Pixel 6 with API 34 recommended)
-
Click Run → Run 'app' (or
^ + R) -
App launches → You should see:
- Bottom navigation with 5 tabs
- "Code" screen as default (placeholder)
- Material 3 themed UI (purple gradient)
┌─────────────────────────────────┐
│ 🤖 XRAiAssistant │ ← Top bar
├─────────────────────────────────┤
│ │
│ Chat Screen - Coming Soon │ ← Placeholder
│ │
│ │
├─────────────────────────────────┤
│ 💬 Code │ ▶️ Scene │ ⚙️ | 📚 | ⏱ │ ← Bottom nav
└─────────────────────────────────┘
- ✅ Navigation - Tap tabs to switch screens
- ✅ Settings Modal - Tap ⚙️ to open (placeholder)
- ✅ Examples Modal - Tap 📚 to open (placeholder)
- ✅ Theme - Material 3 with light/dark mode support
- ✅ Smooth Animations - Screen transitions
- 🚧 AI chat integration
- 🚧 Message history
- 🚧 Code generation
- 🚧 3D scene rendering
- 🚧 CodeSandbox deployment
# Clean and retry
./gradlew clean
# In Android Studio: File → Invalidate Caches / Restart- Ensure JDK 17+ is installed
- Android Studio → Preferences → Build Tools → Gradle
- Set "Gradle JDK" to 17 or higher
- Android Studio → Preferences → Appearance & Behavior → System Settings → Android SDK
- Install Android 14.0 (API 34) and Build Tools 34.0.0
- Check Logcat panel in Android Studio
- Look for
FATAL EXCEPTIONorAndroidRuntime - Verify
AndroidManifest.xmlhas correct activity declaration
XRAiAssistantAndroid/
├── app/
│ ├── src/main/java/com/xrai/assistant/
│ │ ├── XRAiApplication.kt ← App entry point
│ │ ├── di/AppModule.kt ← Dependency injection
│ │ ├── domain/model/ ← Core data models
│ │ │ ├── ChatMessage.kt
│ │ │ ├── AIProvider.kt
│ │ │ ├── AIModel.kt
│ │ │ └── Library3D.kt
│ │ └── presentation/
│ │ ├── MainActivity.kt ← Main activity
│ │ ├── navigation/NavGraph.kt ← Navigation setup
│ │ └── theme/ ← Material 3 theme
│ ├── build.gradle.kts ← App dependencies
│ └── src/main/AndroidManifest.xml ← App configuration
├── gradle/libs.versions.toml ← Version catalog
├── build.gradle.kts ← Root build config
└── settings.gradle.kts ← Project settings
-
Read the plan: ANDROID_IMPLEMENTATION_PLAN.md
-
Create data layer:
app/src/main/java/com/xrai/assistant/data/ ├── remote/ │ ├── TogetherAiService.kt ← Retrofit service │ ├── OpenAiService.kt │ └── dto/ ← API request/response models └── repository/ └── ChatRepositoryImpl.kt ← Repository implementation -
Implement ChatViewModel:
@HiltViewModel class ChatViewModel @Inject constructor( private val chatRepository: ChatRepository ) : ViewModel() { val messages = chatRepository.getMessages() .stateIn(viewModelScope, SharingStarted.Lazily, emptyList()) fun sendMessage(text: String) { viewModelScope.launch { chatRepository.sendMessage(text).collect { response -> // Handle streaming AI response } } } }
-
Build Chat UI:
@Composable fun ChatScreen(viewModel: ChatViewModel = hiltViewModel()) { val messages by viewModel.messages.collectAsState() LazyColumn { items(messages) { message -> MessageItem(message) } } ChatInput(onSend = { viewModel.sendMessage(it) }) }
- Full Implementation Plan: ANDROID_IMPLEMENTATION_PLAN.md
- Android README: XRAiAssistantAndroid/ANDROID_README.md
- Setup Complete Summary: XRAiAssistantAndroid/ANDROID_SETUP_COMPLETE.md
- iOS Reference: XRAiAssistant/
- Android Studio opened project without errors
- Gradle sync completed successfully
- Project builds (no compilation errors)
- App runs on device/emulator
- Bottom navigation shows 5 tabs
- Can navigate between tabs
- Settings modal opens when tapping ⚙️
- Examples modal opens when tapping 📚
All checked? → Phase 1 Complete! 🎉
Not working? → Check Troubleshooting or open an issue.
Next: Start Phase 2 - AI Integration 🚀