Inertial Sensor Data Collection with Google Maps Integration

An Android application that collects inertial sensor data (accelerometer and gyroscope) alongside GPS location readings, visualized on a Google Maps interface. This app is designed to support research on cognitive architectures by providing sensor-logging capabilities for mobile environments.

This project was developed as part of the Cognitive Architectures research line from the Hub for Artificial Intelligence and Cognitive Architectures (H.IAAC) of the State University of Campinas (UNICAMP). See more projects from the group here.

Repository Structure

  • app/: Main Android application module containing source code, resources, and build configuration

    • src/main/java/com/henriquehpds/ic/gmapsagoravai/: Java source files

      • MapsActivity.java — Main activity: Google Maps display with concurrent GPS location tracking and inertial sensor logging (accelerometer + gyroscope). Exports data to CSV on pause/destroy.

      • SensorActivity.java — Alternative activity: standalone inertial sensor reader that logs accelerometer and gyroscope data to a CSV file.

    • src/main/res/: Android resources (layouts, drawables, themes, strings)

    • build.gradle.kts: Module-level build configuration with dependencies

  • build.gradle.kts: Project-level Gradle build file

  • settings.gradle.kts: Gradle settings

  • gradle.properties: Gradle configuration properties

  • secrets.properties: Local file for Google Maps API key (not committed to version control)

  • local.defaults.properties: Default values for the secrets plugin

  • LICENSE: Project license file

Dependencies / Requirements

  • Android Studio (Hedgehog or newer recommended) for building and running the project

  • Android SDK version 36 (compile SDK) with minimum support for API 24 (Android 7.0)

  • Google Maps API Key — obtain one from the Google Cloud Console

  • Gradle 8.x (wrapped via gradlew)

Key libraries used (automatically resolved by Gradle):

  • com.google.android.gms:play-services-maps:19.2.0 — Google Maps SDK

  • com.google.android.gms:play-services-location:21.3.0 — Fused Location Provider

  • androidx.appcompat:appcompat:1.7.1 — AndroidX support

  • Google Maps Secrets Gradle Plugin — for API key management

Installation / Usage

  1. Clone the repository:

    git clone https://github.com/H-IAAC/gmaps-android-sensors.git
    
  2. Open the project in Android Studio.

  3. Configure your Google Maps API key:

    • Create a secrets.properties file in the project root (or edit the existing one): .. code-block:: properties

      MAPS_API_KEY=YOUR_API_KEY_HERE

    • The key is injected into AndroidManifest.xml via the google.maps.platform.secrets Gradle plugin.

  4. Build and run on a physical Android device (7.0+ / API 24+) or emulator with Google Play services:

    ./gradlew assembleDebug
    

    Or click Run in Android Studio.

Behavior

  • MapsActivity (launcher): Displays a Google Map. While active, it reads:

    • Accelerometer and gyroscope data at SENSOR_DELAY_NORMAL rate

    • GPS location via the Fused Location Provider every 2 seconds

    • On pause or destroy, exports:

      • sensor_data.csv — columns: timestamp,type (ACCEL|GYRO),x,y,z

      • location_data.csv — columns: timestamp,latitude,longitude

  • SensorActivity (standalone sensor reader): Logs accelerometer and gyroscope at SENSOR_DELAY_GAME rate and exports inertial.csv on pause.

Output files are saved to the app’s external files directory (accessible via device file explorer or ADB).

Authors

Citation

@software{Parede_de_Souza_Inertial_Sensor_Data,
author = {Parede de Souza, Henrique and Dornhofer Paro Costa, Paula},
license = {GPL-3.0},
title = {{Inertial Sensor Data Collection with Google Maps Integration}},
url = {https://github.com/H-IAAC/gmaps-android-sensors}
}

Acknowledgements

This study was financed by the São Paulo Research Foundation (FAPESP), Brasil. Process Number 2024/23473-6.

Project supported by the brazilian Ministry of Science, Technology and Innovations, with resources from Law No. 8,248, of October 23, 1991