Building an Android app for a research study: a practical guide
Frameworks, Health Connect, background sensing, device testing, Google Play rules and distribution for Android study apps, with a plan for this week.

- Android has no official research kit: start from ResearchStack, Samsung Research Stack, Beiwe or a hosted platform before building from scratch.
- Read health data through Health Connect, ask only for the data types in your protocol, and store each record's source device.
- Expect the system and phone makers to stop background work; use WorkManager, typed foreground services and hourly heartbeats.
- Plan Google Play declarations and the distribution route early, and archive every app release that reached participants.
An Android app for a research study collects consent, surveys and sensor data from participants' own phones, then sends them to a server the study controls. In short: start from an open research framework or a hosted platform rather than a blank project, read health data through Health Connect, design for background limits and aggressive battery savers from day one, and decide early how the app will reach participants, because Google Play has its own rules for health and human-subjects research apps.
Android runs on most of the world's smartphones (StatCounter tracks the split month by month), so an iPhone-only study leaves many potential participants out, especially outside North America. Our guide to building an iOS app for a research study covers ResearchKit and Apple's review; this article covers what is different on Android, where there is no single official research kit and thousands of device models behave slightly differently.
A pilot with a few dozen participants can be built by a lab developer on top of an existing framework. Once the app has to run for months on many phone brands, sync wearable data and pass a hospital security review, the work looks more like product engineering than research. At that point some groups bring in a team that specialises in Android healthcare app development, while the investigators keep ownership of the protocol, the data dictionary and the analysis code.
What is different about building a study app on Android?
Three things make Android study apps harder than iOS ones: there is no first-party research framework, the operating system and phone makers limit background work in different ways, and the devices themselves vary widely.
- No official research kit. Apple maintains ResearchKit; Google does not ship an equivalent. You choose between community frameworks, research platforms and a custom build.
- Background limits. Doze mode, app standby buckets and foreground service rules decide when your code may run. Some manufacturers add their own battery savers on top, documented by the community site Don't kill my app!
- Device variety. Sensor sampling rates, step counters and Bluetooth stacks differ between models, which affects data quality as well as stability.
- Health data in one place. On the plus side, Health Connect now gives apps a single on-device store for steps, heart rate, sleep and other records written by phones, watches and fitness apps.
Which frameworks and platforms can you start from?
Start from an existing research framework or platform unless your protocol needs something none of them offers. Consent screens, scheduled surveys and secure upload are solved problems, and writing them again costs months.
| Option | What it is | Good for | Watch out for |
|---|---|---|---|
| ResearchStack | Open-source Android framework from Cornell Tech and Open mHealth, modelled on ResearchKit | Consent, surveys and active tasks in a familiar structure | Check recent commit activity before you depend on it |
| Samsung Research Stack | Open-source app SDK, backend and web portal for health studies | Studies that use Galaxy Watch and phone sensors with a ready backend | Strongest on Samsung hardware; read the licence and data flow |
| Beiwe | Open-source smartphone sensing platform from the Onnela Lab at Harvard | Passive sensing (GPS, accelerometer, phone use) plus surveys, with a study backend | You run the backend on your own cloud account |
| Hosted research platforms | Commercial or institutional services with apps for both platforms | Standard surveys and wearable sync without an in-house developer | Licence cost, data location and export formats |
| Custom app in Kotlin | Your own app using Jetpack libraries and Health Connect | Novel tasks, unusual sensors, integration with clinical systems | Highest build and maintenance cost |
If the study is mainly forms filled in by field staff, a form builder such as ODK or KoboToolbox is usually enough. Our comparison of mobile data collection apps for research explains when a form is enough and when to build.
How do you read health data with Health Connect?
Use Health Connect to read health and fitness records on the phone, and ask only for the data types your protocol names. Health Connect is part of the Android framework from Android 14 and is installed as a separate app from Google Play on older versions; its developer guide documents the rules below.
- Per-type permissions. Participants grant steps, heart rate, sleep and so on one by one, and can revoke each at any time. Your app has to keep working with whatever subset they grant.
- A 30-day history window. By default an app can read data from up to 30 days before the first permission was granted. Older records need the separate history permission.
- Background reads need their own permission. To read while the app is not on screen, request
READ_HEALTH_DATA_IN_BACKGROUNDand schedule reads with WorkManager. - Aggregate, do not sum. For cumulative types such as steps, use the aggregate API, which removes duplicates when a phone and a watch both record the same walk.
- Record the source. Every record carries its data origin and device metadata. Store them, because steps from a wrist sensor and from a phone in a pocket are not the same measurement.
Health Connect only covers what other apps and devices write into it. Raw accelerometer streams, GPS traces and custom Bluetooth sensors still come through the Android sensor, location and Bluetooth APIs directly. For instruments you build yourself, see our guide to code for research sensors and data loggers.
How do you keep passive data collection running?
Plan for the operating system to stop your app, and design collection so that gaps are small, detected and recorded. Missing data in passive sensing studies is the rule, not the exception.
- Use WorkManager for periodic jobs. Uploads, Health Connect reads and survey reminders belong in scheduled work that the system can defer but will run.
- Use a foreground service only for continuous sensing. From Android 14 every foreground service must declare a type, such as
healthorlocation, with the matching permission, as described in the foreground service types guide. The service also shows a permanent notification, which participants need to be told about. - Batch sensor readings. Sample at the lowest rate your analysis needs and write in batches. High sampling rates drain the battery and lead participants to uninstall.
- Handle manufacturer battery savers. Walk participants through the battery settings for their phone brand at enrolment and check, inside the app, whether the app is exempt from battery optimisation.
- Log heartbeats. Record a small "still alive" event every hour. Gaps in heartbeats tell you whether missing data came from the participant or from the phone.
How do you test across Android devices?
Test on the phone models your participants actually own, not only on the developers' phones. Ask for the phone make and Android version on the screening form and build your test set from the most common answers.
- Keep a small device lab. Three to six physical phones from different manufacturers and Android versions usually catch most battery and permission problems.
- Use emulators for logic, phones for sensors. Emulators are fine for surveys and scheduling but cannot tell you how a real step counter or Bluetooth chip behaves.
- Automate what you can. Unit tests for scoring and scheduling, plus UI tests for the consent flow, run in CI on every change. Our guide to testing research code covers the basics.
- Run a field pilot. Ten to twenty participants for two weeks usually show data gaps that no lab test reveals.
If the app produces outcome data for a clinical trial, testing becomes documented validation. Our piece on validating research software for clinical studies explains what auditors expect.
What will Google Play and your ethics board ask for?
Expect two reviews: your ethics board reviews the protocol and consent, and Google Play reviews the app's permissions, data use and health claims. Neither replaces the other.
- Health apps declaration. Every app on Google Play must complete the health apps declaration in Play Console, and human subjects research is one of the listed categories. See the Play Console help on health app categories.
- Ethics approval and consent. Google's policy requires research apps to follow the applicable rules, including informed consent and ethics committee approval, and to show proof when asked.
- Health Connect access. Apps that read Health Connect data declare each data type and its purpose in Play Console, and publish a privacy policy that matches.
- Foreground service declaration. Apps that target Android 14 or later also declare their foreground service types in Play Console.
- Restricted permissions. Call log and SMS permissions are tightly restricted on Google Play. A study that needs them usually distributes the app outside the store.
Tell your ethics board exactly which data types, sampling rates and retention periods the app uses. Vague protocol text such as "phone sensor data" tends to come back with questions.
How do participants install the app?
Choose the distribution route by study size and by how much control you need over updates. The route also decides how long it takes to go live.
| Route | Best for | Notes |
|---|---|---|
| Google Play closed testing | Pilots and invitation-only studies | Participants join by email list or Google Group; the app is not public |
| Google Play production | Large or open-enrolment studies | New personal developer accounts must first run a closed test with at least 12 testers for 14 days (Play Console help); organisation accounts are exempt |
| Direct download of the APK | Small studies needing restricted permissions | Participants allow installs from unknown sources; you handle updates yourself |
| Study-provided phones with device management | Clinical trials and vulnerable groups | Most control and best data quality; costs hardware and support time |
Publish under your institution's organisation account if you can. It avoids the closed-test delay and keeps the app with the institution when a postdoc leaves.
Where should the data go?
Send data to a server your institution or data protection officer has approved, encrypt it on the phone and in transit, and keep identifiers apart from sensor data. Never leave the only copy on the phone.
- Pseudonymise on enrolment. Give each participant a study ID and keep the key linking it to their identity in a separate system.
- Upload in small batches. Retry on failure and upload on Wi-Fi when files are large, so participants' data plans are not drained.
- Store raw and processed data separately. Raw sensor files are your source of truth; derived features should be rebuilt by versioned code.
- Expose data to the analysis team through one interface. A small API over the study database keeps scripts, dashboards and the app reading the same records; see our guide to building a web API for research data.
Who should build and maintain the app?
Match the builder to how long the app must run and how many people depend on it. The investigators should always own the protocol, the data dictionary and the scoring rules.
- The lab itself for a pilot on an existing platform with a few dozen participants.
- A research software engineer when the app supports several studies or must outlive one grant; see our guide to research software engineers.
- An outside development team when you need wearable integration, hospital system links, support for many devices or a service-level promise. Keep the code, the tests and the release history in your own repository so the study does not depend on one vendor.
Budget for maintenance as well as the build. Every Android release changes permissions or background rules, and Google Play requires apps to target a recent API level, so an app nobody updates for a year may stop receiving updates to participants.
How do you keep the app reviewable and citable?
Treat the app as research software: version it, archive it, and cite the exact version that collected each participant's data.
- Keep the source in version control with a tagged release for every build that reached participants.
- Store the app version with every uploaded record, so analysts can tell which code produced which data.
- Archive each release with a DOI; our guide to archiving code with a DOI shows how.
- Choose an open licence where the protocol allows it, following our licence primer for research code.
- Describe sampling rates, permissions and known data gaps in the methods section.
What to do this week: scope your Android study app
- List every data type your protocol needs and mark which come from Health Connect, which from raw sensors and which from surveys.
- Try Beiwe, Samsung Research Stack and one hosted platform against that list.
- Ask your screening survey for phone make and Android version, and buy or borrow the three most common models.
- Check whether your institution has a Google Play organisation account you can publish under.
- Write a one-page data flow for the ethics board: what is collected, how often, where it is stored and for how long.
Questions about Android study apps
Is there an Android version of ResearchKit?
Google does not publish an official equivalent. Open-source frameworks such as ResearchStack and Samsung Research Stack follow a similar structure, and platforms such as Beiwe provide an Android app with a study backend.
Can an Android study app collect data in the background?
Yes, within limits. Use WorkManager for periodic reads and uploads, a typed foreground service for continuous sensing, and the background read permission for Health Connect. Expect some gaps and log them.
How far back can an app read Health Connect data?
By default, up to 30 days before the participant first granted permission. Reading older records requires the separate history permission, which the participant must also grant.
Do research apps need special approval on Google Play?
Every app completes the health apps declaration in Play Console, and human subjects research is a listed category. Google expects ethics approval and informed consent and may ask for proof.
Should a study build one app for Android and iOS or two native apps?
A cross-platform framework such as Flutter saves effort for surveys and simple sensing. Native apps are safer when the study depends on background sensing or platform health stores.
How many test devices does an Android study app need?
Three to six phones from different manufacturers and Android versions catch most problems. Choose them from the phone models participants report at screening.
Keep reading. More from the desk.

Building an iOS app for a research study: a practical guide
A study app looks like a coding problem. Most of the work is protocol, consent, data handling and maintenance. This guide walks through the decisions in the order a research team actually meets them.

Mobile data collection apps for research: when a form is enough and when to build
Most field studies never need custom software. This guide shows what form-based tools handle well, the signals that a study has outgrown them and how to keep either route reviewable.

How to validate research software for clinical studies
What ICH E6(R3) and FDA guidance expect, how to scale testing to risk, and how to validate analysis scripts, study apps and the paperwork around them.