Skip to content

Repository files navigation

AR Dimension

Intelligent AR measurement app for Android

AR Dimension combines Google ARCore for spatial awareness with Google Gemini Vision API for scene understanding to provide accurate room and object measurements without manual calibration.

Features

  • 📏 Automatic Room Measurement - Point at a room and get dimensions instantly
  • 🤖 AI-Powered Analysis - Gemini Vision API understands scenes and estimates dimensions
  • 🎯 ARCore Integration - Accurate plane detection and spatial tracking
  • 📱 No Calibration - Just point and measure
  • 💾 Measurement History - Save and review past measurements
  • 🎨 Material 3 Design - Modern, clean interface

Technology Stack

  • Language: Kotlin
  • AR: Google ARCore (plane detection, anchors)
  • Vision AI: Google Gemini Vision API
  • Camera: Camera2 API
  • Database: Room Database
  • UI: Jetpack Compose
  • Async: Kotlin Coroutines
  • Architecture: Clean separation (UI, data, networking, AR)

Requirements

Hardware

  • Android device with ARCore support
  • Android 9.0 (API 28) or higher
  • Camera permission

Recommended: Samsung Galaxy Fold 6 or similar ARCore-capable device

Check device compatibility: https://developers.google.com/ar/devices

Software

  • Android Studio Hedgehog (2023.1.1) or later
  • JDK 17
  • Google Gemini API key

Quick Start

1. Clone the Repository

git clone <repository-url>
cd TapMeasure

2. Get Gemini API Key

  1. Visit https://makersuite.google.com/app/apikey
  2. Sign in with Google account
  3. Create API key
  4. Copy the key

3. Configure API Key

cp local.properties.example local.properties

Edit local.properties:

GEMINI_API_KEY=your_actual_api_key_here

4. Build and Run

Open project in Android Studio and run on ARCore-compatible device.

Or use command line:

./gradlew installDebug

Documentation

Project Structure

app/src/main/java/com/ardimension/
├── ar/                 # ARCore integration (planes, anchors)
├── camera/             # Camera2 API (frame capture, permissions)
├── gemini/             # Gemini Vision API (client, prompts, parser)
├── data/               # Data layer (models, database, repository)
│   ├── model/          # Domain models
│   ├── database/       # Room entities, DAOs
│   └── repository/     # Data access abstraction
├── util/               # Utilities (bitmap, logging, constants)
├── config/             # App configuration
└── MainActivity.kt     # Main entry point

Key Components

ARCore Integration

  • ARCoreManager - Session lifecycle management
  • PlaneDetector - Floor, wall, ceiling detection
  • AnchorManager - 3D position tracking

Gemini API

  • GeminiClient - API communication with retry logic
  • PromptGenerator - Structured prompts for scene/object analysis
  • ResponseParser - JSON parsing with validation

Data Layer

  • Room Database - Local measurement storage
  • Repository Pattern - Clean data access API
  • Data Models - Validated domain objects

Usage

  1. Launch App - Grant camera permissions
  2. Point Camera - Aim at room or object
  3. Auto-Analysis - Gemini AI analyzes scene (2 fps)
  4. View Dimensions - See estimated measurements
  5. Save - Store measurements for later

Development

Run Tests

./gradlew test

Code Style

  • Kotlin coding conventions
  • 4 spaces indentation
  • 120 character line length
  • KDoc comments for public APIs

Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

Performance

  • Frame Rate: 2 fps (controlled to reduce API calls)
  • API Timeout: 5 seconds
  • Retries: Up to 2 retries with exponential backoff
  • Confidence Threshold: 0.5 minimum, 0.65+ considered reliable

Roadmap

  • Real-time AR dimension overlay
  • Export measurements (PDF/CSV)
  • Multi-room floor plans
  • Object database for improved accuracy
  • Offline mode with local ML
  • User calibration mode

Known Limitations

  • ARCore requires supported hardware
  • Gemini API rate limits (60/min, 1500/day free tier)
  • Accuracy depends on lighting and scene clarity
  • Large rooms (>20m) may have reduced accuracy

License

[Your License Here]

Credits

  • ARCore: Google AR platform
  • Gemini: Google's multimodal AI
  • Jetpack: Android modern development toolkit

Support

  • Issues: Open GitHub issue
  • Documentation: See /docs folder
  • Stack Overflow: Tag arcore, gemini-api

Contact

[Your Contact Information]


Built with ❤️ for intelligent AR measurement

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages