Skip to main content

Prerequisites

Before building MiTensión, ensure you have the following installed:
1

Java Development Kit (JDK)

Install JDK 11 or higher. The project is configured to use Java 11.
# Verify Java installation
java -version
2

Android Studio

Download and install Android Studio (latest stable version recommended).
3

Android SDK

Ensure you have Android SDK installed with the following components:
  • Android SDK Platform 36
  • Android SDK Build-Tools
  • Android SDK Platform-Tools
4

Git

Install Git to clone the repository.
# Verify Git installation
git --version

Clone the Repository

Clone the MiTensión source code from your repository:
git clone <repository-url>
cd MiTension
Replace <repository-url> with the actual URL of the MiTensión repository.

Project Configuration

The project uses Gradle with Kotlin DSL for build configuration. Here are the key specifications: Build Configuration (app/build.gradle.kts):
android {
    namespace = "com.fxn.mitension"
    compileSdk = 36

    defaultConfig {
        applicationId = "com.fxn.mitension"
        minSdk = 31
        targetSdk = 35
        versionCode = 1
        versionName = "1.0"
    }
}
Plugin Versions:
  • Kotlin: 1.9.23
  • KSP (Kotlin Symbol Processing): 1.9.23-1.0.19
  • Compose Compiler: 1.5.11

Build the App

You can build the app using either Android Studio or the command line.
1

Open the Project

  1. Launch Android Studio
  2. Select File > Open
  3. Navigate to the cloned MiTension directory
  4. Click OK to open the project
2

Sync Gradle

Android Studio will automatically sync Gradle dependencies. If not:
  1. Click File > Sync Project with Gradle Files
  2. Wait for the sync to complete
3

Build APK

To build a debug APK:
  1. Select Build > Build Bundle(s) / APK(s) > Build APK(s)
  2. Wait for the build to complete
  3. Click locate in the notification to find the APK
The APK will be located at:
app/build/outputs/apk/debug/app-debug.apk
4

Build Release APK (Optional)

For a release build:
  1. Select Build > Generate Signed Bundle / APK
  2. Choose APK
  3. Configure your signing key or create a new one
  4. Select release build variant
  5. Click Finish

Install the App

Once the APK is built, install it on your Android device.
1

Enable Developer Options

On your Android device:
  1. Go to Settings > About phone
  2. Tap Build number 7 times to enable Developer Options
  3. Go back to Settings > System > Developer options
  4. Enable USB debugging
2

Connect Your Device

Connect your Android device to your computer via USB.
# Verify device is connected
adb devices
You should see your device listed.
3

Install APK

Install the APK using ADB:
adb install app/build/outputs/apk/debug/app-debug.apk
Or from Android Studio:
  1. Select your device from the device dropdown
  2. Click the Run button (green triangle)
4

Grant Permissions

When you first launch the app:
On Android 13 (API 33) and higher, the app will request notification permission for reminders. This is optional but recommended for the reminder feature.
Tap Allow when prompted for notification permission.

Alternative Installation Methods

If you don’t have USB debugging enabled:
  1. Copy the APK file to your device (via email, cloud storage, etc.)
  2. On your device, locate the APK file
  3. Tap the APK to install
  4. You may need to enable Install from Unknown Sources in Settings
To test on an Android emulator:
  1. Open AVD Manager in Android Studio
  2. Create a virtual device with API level 31 or higher
  3. Start the emulator
  4. Run the app from Android Studio or use:
    adb install app/build/outputs/apk/debug/app-debug.apk
    

Verify Installation

After installation, verify that MiTensión is working correctly:
1

Launch the App

Find and tap the MiTensión icon in your app drawer.
2

Check Initial Screen

You should see the measurement screen showing:
  • Current time period (Morning, Afternoon, or Night)
  • Measurement counter (Measurement 1/3)
  • Two input fields for systolic and diastolic values
  • Save and View Calendar buttons
3

Verify Reminders (Optional)

Background reminders are configured to run every 2 hours using WorkManager. These will start automatically after installation.

Troubleshooting

Ensure Android SDK is properly installed:
  1. Open Android Studio
  2. Go to Tools > SDK Manager
  3. Install Android SDK Platform 36
  4. Set ANDROID_HOME environment variable
Verify your device meets the minimum requirements:
  • Android 12 (API 31) or higher
  • Check logcat for error messages:
    adb logcat | grep MiTension
    
  • Ensure USB debugging is enabled
  • Check device is properly connected: adb devices
  • Uninstall previous versions: adb uninstall com.fxn.mitension
  • Enable “Install from Unknown Sources” if installing manually
  • Check your internet connection
  • Clear Gradle cache:
    ./gradlew clean --refresh-dependencies
    
  • Verify Kotlin version 1.9.23 is properly configured

Project Structure

Here’s an overview of the MiTensión project structure:
MiTension/
├── app/
│   ├── src/
│   │   ├── main/
│   │   │   ├── java/com/fxn/mitension/
│   │   │   │   ├── MainActivity.kt
│   │   │   │   ├── MiTensionApplication.kt
│   │   │   │   ├── data/              # Room database entities and DAOs
│   │   │   │   ├── ui/                # Compose screens and ViewModels
│   │   │   │   ├── util/              # Helper classes and enums
│   │   │   │   └── alarm/             # WorkManager reminder worker
│   │   │   ├── res/
│   │   │   │   ├── values/            # Spanish strings (default)
│   │   │   │   ├── values-en/         # English strings
│   │   │   │   └── values-gl/         # Galician strings
│   │   │   └── AndroidManifest.xml
│   │   ├── test/                      # Unit tests
│   │   └── androidTest/               # Instrumented tests
│   ├── build.gradle.kts
│   └── schemas/                       # Room database schemas
├── build.gradle.kts
└── settings.gradle.kts

Next Steps

Quick Start Guide

Learn how to use MiTensión to record and track your blood pressure

Introduction

Learn more about MiTensión’s features and technology stack

Build docs developers (and LLMs) love