AI-powered Extended Reality development platform for Android
Kotlin/Compose implementation of m{ai}geXR, bringing powerful AI-assisted 3D development capabilities to Android devices.
- Together.ai (Primary) - DeepSeek R1 70B, Llama 3.3 70B, Qwen models
- OpenAI - GPT-4o and other models
- Anthropic - Claude 3.5 Sonnet
- Dual-parameter control (Temperature + Top-p)
- Streaming AI responses with real-time generation
- Babylon.js v8.22.3 - Professional WebGL engine
- Three.js r171 - Popular lightweight 3D library
- React Three Fiber 8.17.10 - Declarative React renderer
- A-Frame v1.7.0 - WebXR VR/AR framework
- Automatic framework switching with specialized AI prompts
- Monaco code editor integration (via WebView)
- Real-time 3D scene rendering
- Code injection and execution
- Build system for React frameworks
- Hot reload capabilities
- Encrypted API key storage
- Local settings persistence
- No data collection
- User-controlled AI provider selection
ChatViewModel- Main AI integration hub with Compose StateFlowLibrary3DRepository- 3D framework management systemAIProviderRepository- Multi-provider API client with retry logicSettingsDataStore- Encrypted preferences with DataStore
- Jetpack Compose - Modern declarative UI
- Material Design 3 - Consistent Android design language
- Bottom Navigation - Code β Run Scene β Settings workflow
- Modal Bottom Sheets - Progressive disclosure settings panel
// Multi-provider AI architecture
class ChatViewModel @Inject constructor(
private val aiProviderRepository: AIProviderRepository,
private val library3DRepository: Library3DRepository,
private val settingsRepository: SettingsRepository
) {
// Intelligent AI routing based on model selection
suspend fun sendMessage(content: String, currentCode: String = "") {
val library = currentLibrary.value
val enhancedPrompt = buildPrompt(content, currentCode, library)
val response = aiProviderRepository.generateResponse(
prompt = enhancedPrompt,
model = selectedModel.value,
temperature = temperature.value,
topP = topP.value,
systemPrompt = systemPrompt.value
)
processAIResponse(response, library)
}
}- Kotlin 1.9.20 - Modern Android development
- Jetpack Compose - Declarative UI framework
- Material Design 3 - Google's latest design system
- Android Gradle Plugin 8.2.0 - Latest build tools
- Hilt - Dependency injection
- ViewModel + StateFlow - Reactive state management
- DataStore Preferences - Type-safe preferences
- Encrypted SharedPreferences - Secure API key storage
- Retrofit + OkHttp - HTTP client for AI APIs
- Kotlin Coroutines - Async programming
- Kotlinx Serialization - JSON processing
- AndroidX WebKit - Modern WebView APIs
- JavaScript Bridge - Bidirectional communication
- Custom URL Schemes - Asset serving
app/src/main/java/com/xraiassistant/
βββ MainActivity.kt # App entry point
βββ XRAiAssistantApplication.kt # Hilt application
βββ data/
β βββ local/
β β βββ SettingsDataStore.kt # Encrypted settings storage
β βββ models/
β β βββ ChatMessage.kt # Chat data models
β β βββ AIModel.kt # AI model definitions
β βββ remote/
β β βββ AIProviderService.kt # HTTP AI provider client
β βββ repositories/
β βββ AIProviderRepository.kt # AI provider management
β βββ Library3DRepository.kt # 3D library management
β βββ SettingsRepository.kt # Settings persistence
βββ domain/
β βββ models/
β βββ Library3D.kt # 3D library interface
β βββ AFrameLibrary.kt # A-Frame implementation
βββ ui/
β βββ components/
β β βββ ChatScreen.kt # AI conversation UI
β β βββ SceneScreen.kt # 3D playground WebView
β β βββ SettingsScreen.kt # Configuration panel
β β βββ ChatMessageCard.kt # Message display
β βββ screens/
β β βββ MainScreen.kt # Primary navigation
β βββ theme/
β β βββ Color.kt # Material Design colors
β β βββ Theme.kt # Compose theme
β β βββ Type.kt # Typography
β βββ viewmodels/
β βββ ChatViewModel.kt # Core business logic
βββ di/
βββ AppModule.kt # Hilt dependency injection
- Android Studio Flamingo or later
- Android SDK 26+ (Android 8.0+)
- JDK 8 or later
-
Clone the repository:
git clone <repository-url> cd XRAiAssistantAndroid
-
Open in Android Studio:
- File β Open β Select
XRAiAssistantAndroidfolder - Wait for Gradle sync to complete
- File β Open β Select
-
Build and run:
- Connect Android device or start emulator
- Click Run (βΆ) or press
Ctrl+R
-
Configure API keys:
- Launch app on device/emulator
- Tap Settings (βοΈ) in bottom navigation
- Enter API keys for your preferred AI providers:
- Together.ai: Get free key at together.ai
- OpenAI: Get key at platform.openai.com
- Anthropic: Get key at console.anthropic.com
- Select your 3D library in Settings (Babylon.js recommended for beginners)
- Choose an AI model (DeepSeek R1 70B is free and powerful)
- Return to Code tab and ask: "Create a spinning cube with rainbow colors"
- Tap Run Scene when code is generated
- Enjoy your AI-created 3D scene!
- Complete project structure and Gradle configuration
- Core AI integration with multi-provider support
- Library3D framework system (5 libraries)
- Jetpack Compose UI with Material Design 3
- Settings persistence with encrypted API keys
- Chat interface with streaming responses
- Professional parameter control (Temperature + Top-p)
- WebView integration with Monaco editor
- JavaScript bridge for code injection
- 3D scene rendering and execution
- Build system for React frameworks
- Vendor asset management
- Hot reload capabilities
- Advanced WebXR features
- Local RAG system with SQLite
- Multi-framework build pipeline
- Performance analytics
- Offline mode capabilities
We welcome contributions! This project aims to democratize 3D/XR development through AI assistance.
- WebView Integration - Monaco editor and 3D rendering
- Build System - React Three Fiber compilation
- UI/UX - Material Design improvements
- Testing - Unit and integration tests
- Documentation - Code examples and tutorials
See LICENSE file for details.
This Android implementation brings the groundbreaking m{ai}geXR experience to the world's most popular mobile platform. Whether you're learning 3D programming, prototyping XR experiences, or building professional applications, m{ai}geXR makes 3D development as simple as having a conversation.
From idea to immersive experience in seconds. That's the power of AI-assisted XR development. π