Skip to main content

Run the Android Sample

git clone https://github.com/AdvantaHealth/AFCore.git
cd AFCore

# Build the sample (uses :core via local project dep — no GitHub Packages auth needed)
./gradlew :sample:android:assembleDebug

# Or open in Android Studio
open -a "Android Studio" .

In Android Studio, select the sample.android run configuration and hit Run on an emulator (API 26+) or a connected device.

On first launch the Initialize screen will ask for:

These persist in EncryptedSharedPreferences so subsequent launches skip the screen.


What's wired up

Every public AFCore API has a screen in the Compose nav graph:

  • Initialization, authentication, session state, reconfigure
  • Member profile, programs, activity calendar
  • Geofencing add/remove/list, SmartWalking sync, Mental Fitness SpotIt
  • Self-Report, Barcode submission, Diagnostics
  • Push tokens, permission requests, network connectivity
  • Token-lifecycle dev tools (corrupt / expire to exercise refresh paths)
  • Chucker network inspector (debug build only)

The sample doubles as a manual QA harness — see the SDK Troubleshooting page for repro recipes.


Distribute to testers

./sample/android/scripts/distribute.sh

Builds the debug APK and uploads it to Firebase App Distribution. See SAMPLE_DISTRIBUTION.md for tester-group setup.