Mobile Development 19 min read

HarmonyOS 6: Building a Pocket-Sized Smart Elderly Care System with Distributed Capabilities

This case study details how HarmonyOS 6 distributed features — soft bus, atomic services, distributed data management, and task scheduling — were used to create a unified elderly care platform connecting seniors, families, caregivers, and doctors across devices and locations, with code examples and lessons on elderly-friendly design.

51CTO HarmonyOS Developer Community
51CTO HarmonyOS Developer Community
51CTO HarmonyOS Developer Community
HarmonyOS 6: Building a Pocket-Sized Smart Elderly Care System with Distributed Capabilities

Project Background: From Fragmented Handoffs to Distributed Care Assistant

During engagement with a combined medical-nursing institution, pain points mirroring grassroots healthcare challenges but more complex were discovered:

Nursing shift handovers remain split between electronic systems and voice, causing fragmentation.

Seniors' daily health data (blood pressure, glucose, sleep) is siloed across facility and home environments, preventing a continuous personal health profile.

Families rely on sporadic phone calls for updates — information is neither transparent nor timely.

Community doctors on weekly rounds face scattered paper records and disjointed data, lacking efficient decision support.

"Can we let seniors manage their health as simply as using WeChat, while letting families, nurses, and doctors all see the same real-time, accurate data?"

This challenge aligned with two-year technical accumulation in HarmonyOS distributed capabilities and information-security certifications, prompting a full scenario-driven reconstruction for smart elderly care.

Closing the Loop Across Four Roles: Senior, Family, Caregiver, Doctor

Using HarmonyOS NEXT as the technical foundation, the solution comprises:

Senior & Family: A minimalist HarmonyOS Elderly Care App decomposed into atomic services (one-tap safety check, medication reminder, visit booking) for low-friction use. HarmonyOS wearables auto-sync heart rate, sleep, and step count to family and facility endpoints.

Care Team: Caregiver handheld HarmonyOS terminals and nursing-station smart displays enable bedside instant recording linked to station-wide dashboards via distributed collaboration. Wearables monitor falls and bed-exit anomalies for proactive care and clearer handovers.

Community Doctors: A HarmonyOS follow-up tablet app lets doctors seamlessly and securely pull continuous health records from both facility and home, combined with long-term wearable data for chronic-disease management.

Underlying Collaboration: Distributed soft bus unifies access to wearables, BP monitors, glucose meters, etc. Distributed data management enables cross-device auto-sync and intelligent alerts, forming an integrated data flow from wearables to institutional systems.

Core Value: From Point Tools to Continuous Care

Traditional elderly-care solutions are isolated stacks of devices, apps, and personnel. This design leverages HarmonyOS distributed capabilities to build a seamless "people-devices-scenarios" collaborative organism, shifting from reactive response to proactive care and from fragmented data points to continuous archives.

Technical Implementation: Distributed Capabilities Connecting Four Ends

1. Senior-Friendly Entry: Atomic Services + Write Once, Deploy Everywhere

For 70+ users, a monolithic app is often abandoned in seconds. The team chose HarmonyOS's application model to split the Elderly Care Assistant into multiple atomic services :

[Take Medicine on Time] atomic service: focused on medication reminders and logging.

[Measure Blood Pressure] atomic service: one-tap BP monitor pairing and measurement.

[Chat with Doctor] atomic service: direct entry to text/video consultation.

Via write once, deploy everywhere , the same codebase adapts to senior phones, compact caregiver terminals, and large tablets with only lightweight UI layout differences. This keeps all role endpoints in a single repo while drastically lowering the senior's cognitive load — they only remember a few desktop cards instead of navigating complex menus.

2. Device Access: Distributed Soft Bus Aggregating Home Health Devices

Key devices in the scenario:

BP monitors / glucose meters / weight scales / wearables (steps, sleep).

Mattress sensors in some rooms (turn-over, bed-exit detection).

The team wrapped a "Medical-Care Device Access Layer" around the distributed soft bus so that devices used in nursing homes, seniors' homes, and community health stations all connect through a unified capability:

// Code snippet: Unified device discovery in smart elderly care (example)
import softBus from '@ohos.distributedSoftBus';

class ElderCareDeviceHub {
  private softBusManager?: softBus.SoftBusManager;
  private devices: Map<string, ElderDevice> = new Map();

  async init() {
    this.softBusManager = await softBus.createSoftBusManager({
      networkId: 'ELDER_CARE_NETWORK',
      securityLevel: 'HIGH',
      discoveryMode: 'ACTIVE_PASSIVE',
    });

    await this.softBusManager.startDeviceDiscovery({
      deviceTypes: ['WEARABLE', 'BLOOD_PRESSURE_MONITOR', 'GLUCOSE_METER', 'BED_SENSOR'],
    });

    this.softBusManager.on('deviceFound', (device: ElderDevice) => {
      // Unified device registration, later bound by senior ID and room number
      this.devices.set(device.deviceId, device);
    });
  }
}

This layer enables:

Senior phones to directly discover and bind personally purchased wearables.

Caregiver HarmonyOS PDAs to scan in-room devices.

Nursing-station tablets to view online status of all devices on a floor.

3. Data Interoperability: Distributed Data Management for "Multiple Residences, One Health Record"

Many seniors spend weekends at family homes or stay months in another city. Traditional systems only record facility data, leaving community doctors or new facilities blind to outside periods.

Using distributed data management , the team designed a "multiple residences, one health record" model:

Using elderId as primary key, metrics collected in nursing home, family, and community health stations are written into the same distributed KV store.

Critical events (falls, nocturnal bed-exit anomalies, sustained hypertension) are recorded as independent event streams for quick clinician screening.

// Code snippet: Distributed storage of multi-scenario senior health profile (example)
import distributedKVStore from '@ohos.data.distributedKVStore';

class ElderHealthProfileStore {
  private kvStore?: distributedKVStore.KVStore;

  async init(elderId: string) {
    const manager = distributedKVStore.createKVManager({
      context: this.context,
      bundleName: 'com.eldercare.assistant',
    });

    this.kvStore = await manager.getKVStore(`elder_profile_${elderId}`, {
      createIfMissing: true,
      encrypt: true,
      autoSync: true,
      backup: true,
      securityLevel: distributedKVStore.SecurityLevel.S3,
    });

    this.kvStore.on('dataChange', (changeInfo) => {
      // Caregiver tablet, family app, community doctor tablet all refresh in real time
      this.onProfileChanged(changeInfo);
    });
  }
}

Through this abstraction, a community doctor on rounds simply logs into their HarmonyOS tablet to see the senior's BP/glucose trends over the past month across both facility and home — no switching between systems.

4. Cross-Device Collaboration: Visit Task Continuation and Alert Linkage

A typical chain in smart elderly care is cross-device flow of "visit tasks" and "anomaly alerts":

Family selects a weekend slot via the [Visit Booking] atomic service on their phone.

Facility front desk confirms and assigns a caregiver on the nursing-station tablet.

Caregiver receives the task on their HarmonyOS terminal and completes accompaniment/examination records.

If abnormal metrics appear (e.g., systolic BP persistently > 160), the system auto-escalates an alert to the community doctor's follow-up tablet, flagged for the next visit.

Behind this chain, distributed task scheduling + cross-device collaboration handle task-state migration and priority control:

// Code snippet: Visit task continuation between front-desk tablet and caregiver terminal (example)
import distributedMissionManager from '@ohos.distributedMissionManager';

async function continueVisitTaskOnCaregiver(missionId: string, caregiverDeviceId: string) {
  await distributedMissionManager.startContinuation({
    missionId,
    targetDeviceId: caregiverDeviceId,
    reversible: false, // Task archived by system after completion, not migrated back to front desk
  });
}

For alerts, the priority mechanism in distributed task scheduling designates high-risk events like falls/bed-exit as a "red channel". Once any endpoint acknowledges handling, other endpoints stop popping up alerts and only retain the record, avoiding alert fatigue across multiple roles.

HarmonyOS 6.0 New Features: Creating a Seamless Data-Flow Experience

During shift handover, caregivers tap their work phone against the nursing-station large screen to instantly transfer shift records and pending items — silent yet clear. Gesture-based rapid cross-device file transfer boosts processing efficiency.

aboutToAppear(): void {
  let capabilityRegistry: harmonyShare.RecvCapabilityRegistry = {
    windowId: 999, // Example value; replace with actual windowId in use
    capabilities: [{ // Set supported data types and counts for receiver
      utd: utd.UniformDataType.IMAGE,
      maxSupportedCount: 1,
    }]
  }
  // Register sandbox 'dataReceive' listener
  harmonyShare.on('dataReceive', capabilityRegistry, (receivableTarget: harmonyShare.ReceivableTarget) => {
    let uiContext: UIContext = this.getUIContext();
    let context = uiContext.getHostContext() as common.UIAbilityContext;
    receivableTarget.receive(context.filesDir, { // Example path; replace with actual path
      onDataReceived: (sharedData: systemShare.SharedData) => {
        let sharedRecords = sharedData.getRecords();
        sharedRecords.forEach((record: systemShare.SharedRecord) => {
          // Process shared data
        });
      },
      onResult(resultCode: harmonyShare.ShareResultCode) {
        if (resultCode === harmonyShare.ShareResultCode.SHARE_SUCCESS) {
          // To do things.
        }
      }
    });
  });
}

Lessons Learned: The Hard Part Is People, Not Code

1. Elderly Interaction Habits: Fewer Buttons, Larger Text, Shorter Paths

Initially designed from a pure technology perspective, the team overloaded the senior home screen with many entries (messages, tasks, leaderboards, activities), used a standardized but >6-step device pairing flow, and mixed notification types that seniors couldn't understand.

Field research revealed seniors 60+ commonly:

Fear tapping wrong, hesitate to scroll.

Forget which step they reached last time.

Prefer atomic service cards because "one card = one task" is visible.

The team then compressed core entries to three:

[Today's Schedule] : medication, BP measurement, rehab training.

[Health Cards] : atomic service entries split by BP, glucose, sleep.

[Chat with Family/Doctor] : unified communication entry.

This work essentially means "hide distributed capabilities behind the scenes, make what seniors see simple". The code implements many functions, but for the senior it's just "tap one big button".

2. Privacy & Compliance: Who Can See the Senior's Data?

Unlike hospitals, a senior may have multiple family members, multiple caregivers, and multiple community doctors. Poor permission design easily causes leaks or unclear accountability.

Leveraging HarmonyOS account and device management, the design:

Establishes a primary family account per senior; other family members join via authorization.

Segments visible fields by role: caregivers see only "today's tasks + basic metrics"; doctors see full history and trends.

Logs all cross-device data accesses to audit logs; anomalous access triggers dedicated infosec alerts.

Implementation is not complex, but it determines whether the system can run stably in real medical-care scenarios long-term.

Conclusion: The Temperature of Technology

The biggest realization: truly good technology doesn't make users feel "the power of tech" — it makes them unaware of technology's existence.

HarmonyOS provides not a "faster system" but a new mindset:

From "connecting everything" to "understanding scenarios".

From "feature stacking" to "service flow".

From "data collection" to "relationship maintenance".

From "cold accuracy" to "warm appropriateness".

In this case, stripping away the tech halo and returning to the simple question "how to let seniors live safely, comfortably, and with dignity" reveals: the best intelligence knows when to be smart and when to be a little "dumb".

Code iterates, systems upgrade, but technology's temperature should age like fine wine — richer with time. This journey has only just begun, but the direction is clear: use the most cutting-edge technology to do the simplest things.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

distributed systemsHarmonyOSIoTsmart healthcareelderly caredistributed soft busHarmonyOS 6atomic servicescross-device collaborationdistributed data management
51CTO HarmonyOS Developer Community
Written by

51CTO HarmonyOS Developer Community

The HarmonyOS Developer Community is a learning-oriented community for developers to learn, communicate, ask questions, and share.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.