AI assistant for workout recommendation in mobile app

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1735 services
AI assistant for workout recommendation in mobile app
Complex
~1-2 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    792
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    671
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1097
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    969
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    914
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    495

AI Workout Assistant in Mobile Applications

Workout recommendations depend on personalization based on body data, goals, available equipment, and training history. Without this context, AI generates a generic plan—"3x10 squats"—that ignores a knee injury, home-only training, and yesterday's leg day.

Gathering Personalization Data

Recommendation quality depends directly on profile completeness. Minimum set:

  • Goal: weight loss, muscle gain, endurance, rehabilitation
  • Level: beginner, intermediate, advanced
  • Available equipment (multi-select: barbell, dumbbells, pull-up bar, TRX, bodyweight only)
  • Limitations/injuries: specific areas (lower back, knees, shoulders)
  • Available time per session
  • Training frequency per week
  • Training history: what was done the past 7 days

From native sources, add HealthKit (iOS) or Health Connect (Android 14+) data:

// iOS: load past week workouts from HealthKit
func fetchRecentWorkouts() async throws -> [HKWorkout] {
    let workoutType = HKObjectType.workoutType()
    let predicate = HKQuery.predicateForSamples(
        withStart: Calendar.current.date(byAdding: .day, value: -7, to: Date())!,
        end: Date()
    )
    let sortDescriptor = NSSortDescriptor(key: HKSampleSortIdentifierStartDate, ascending: false)

    return try await withCheckedThrowingContinuation { continuation in
        let query = HKSampleQuery(
            sampleType: workoutType,
            predicate: predicate,
            limit: 20,
            sortDescriptors: [sortDescriptor]
        ) { _, samples, error in
            if let error { continuation.resume(throwing: error); return }
            continuation.resume(returning: (samples as? [HKWorkout]) ?? [])
        }
        healthStore.execute(query)
    }
}

Workout Plan Generation

Prompt with full context:

func buildWorkoutPrompt(profile: UserProfile, recentWorkouts: [WorkoutSummary]) -> String {
    let workoutHistory = recentWorkouts.map {
        "\($0.date.formatted()): \($0.type), \($0.duration) min, \($0.muscleGroups.joined(separator: "+"))"
    }.joined(separator: "; ")

    return """
    Create a workout plan for today.

    User profile:
    - Goal: \(profile.goal)
    - Level: \(profile.level)
    - Available time: \(profile.availableMinutes) minutes
    - Equipment: \(profile.equipment.joined(separator: ", "))
    - Limitations: \(profile.limitations.isEmpty ? "none" : profile.limitations.joined(separator: ", "))

    Recent workouts (last 7 days): \(workoutHistory.isEmpty ? "none" : workoutHistory)

    Rules:
    - Avoid muscle groups trained in last 48 hours
    - If limitation mentions specific area (knee, back), exclude exercises for that area
    - Balance push/pull if goal is hypertrophy

    Return JSON: {
      name, totalMinutes, exercises: [{
        name, sets, reps, restSeconds, muscleGroups: [], notes, videoSearchQuery
      }]
    }
    """
}

videoSearchQuery is a key field. Use it to generate search queries for YouTube/Vimeo to show exercise demos directly in the card.

Real-Time Adaptation

The assistant shouldn't stay silent after delivering the plan. Three adaptation triggers:

  1. User taps "Too hard" → LLM replaces exercise with easier alternative
  2. More time elapsed than planned → suggest shortening remaining sets
  3. All exercises completed 15 minutes early → add bonus block
// Android - exercise adaptation
suspend fun substituteExercise(
    exercise: Exercise,
    reason: SubstitutionReason,
    availableEquipment: List<String>
): Exercise {
    val prompt = """
    The user cannot do "${exercise.name}".
    Reason: ${reason.description}
    Available equipment: ${availableEquipment.joinToString(", ")}
    Target muscles: ${exercise.muscleGroups.joinToString(", ")}

    Suggest ONE simpler/alternative exercise that targets the same muscles.
    Return JSON: {name, sets, reps, restSeconds, muscleGroups: [], notes}
    """

    val response = openAIClient.chat(
        model = "gpt-4o-mini",
        messages = listOf(Message("user", prompt)),
        responseFormat = ResponseFormat.JsonObject
    )
    return json.decodeFromString(response.content)
}

Rest and Recovery

The AI assistant should recommend rest when needed. If HealthKit shows declining HKQuantityType.heartRateVariability or Sleep Analysis < 6 hours, change the plan to stretching or active recovery.

func shouldRecommendRestDay(healthData: HealthSnapshot) -> Bool {
    return healthData.sleepHours < 6.0 ||
           healthData.restingHeartRate > healthData.averageRestingHR * 1.1 ||
           healthData.hrvTrend == .declining
}

This isn't an AI call—simple heuristics on native data. LLM isn't needed.

Timeline Estimates

Basic plan generator without HealthKit—3–5 days. Full assistant with HealthKit/Health Connect, real-time adaptation, rest timers, and workout history—4–6 weeks.