diff options
| author | hc <haocheng.xie@respiree.com> | 2026-04-10 17:39:12 +0800 |
|---|---|---|
| committer | hc <haocheng.xie@respiree.com> | 2026-04-10 17:39:22 +0800 |
| commit | e4fb9966e762852bf17f21c8406501d42fae0b61 (patch) | |
| tree | 658bbdba977ff7846a17ee94b8ed6b676f6ce9dd /android/app/src/main/java/com/ihealthscanner/MainApplication.kt | |
Initial commit: iHealth BLE scanner app with patched SDK v1.5.0
Diffstat (limited to 'android/app/src/main/java/com/ihealthscanner/MainApplication.kt')
| -rw-r--r-- | android/app/src/main/java/com/ihealthscanner/MainApplication.kt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/android/app/src/main/java/com/ihealthscanner/MainApplication.kt b/android/app/src/main/java/com/ihealthscanner/MainApplication.kt new file mode 100644 index 0000000..c079966 --- /dev/null +++ b/android/app/src/main/java/com/ihealthscanner/MainApplication.kt | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | package com.ihealthscanner | ||
| 2 | |||
| 3 | import android.app.Application | ||
| 4 | import com.facebook.react.PackageList | ||
| 5 | import com.facebook.react.ReactApplication | ||
| 6 | import com.facebook.react.ReactHost | ||
| 7 | import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative | ||
| 8 | import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost | ||
| 9 | import com.ihealth.ihealthlibrary.iHealthDeviceManagerPackage | ||
| 10 | |||
| 11 | class MainApplication : Application(), ReactApplication { | ||
| 12 | |||
| 13 | override val reactHost: ReactHost by lazy { | ||
| 14 | getDefaultReactHost( | ||
| 15 | context = applicationContext, | ||
| 16 | packageList = | ||
| 17 | PackageList(this).packages.apply { | ||
| 18 | // Packages that cannot be autolinked yet can be added manually here: | ||
| 19 | add(iHealthDeviceManagerPackage()) | ||
| 20 | }, | ||
| 21 | ) | ||
| 22 | } | ||
| 23 | |||
| 24 | override fun onCreate() { | ||
| 25 | super.onCreate() | ||
| 26 | loadReactNative(this) | ||
| 27 | } | ||
| 28 | } | ||
