`com.mongodb.stitch.android.core` 是 MongoDB Stitch(后演进为 **MongoDB Realm**)在 Android 平台上的核心 SDK 包

张开发
2026/4/19 9:43:32 15 分钟阅读

分享文章

`com.mongodb.stitch.android.core` 是 MongoDB Stitch(后演进为 **MongoDB Realm**)在 Android 平台上的核心 SDK 包
com.mongodb.stitch.android.core是 MongoDB Stitch后演进为MongoDB Realm在 Android 平台上的核心 SDK 包用于在 Android 应用中集成 Stitch 客户端功能。该包提供了与 Stitch 后端服务通信的基础能力包括初始化StitchAppClient连接到指定的 Stitch 应用用户认证匿名、邮箱/密码、第三方登录如 Google、Facebook 等访问服务如 MongoDB Service、HTTP Service、Functions处理客户端 SDK 的生命周期、网络请求、错误回调等⚠️ 重要说明MongoDB已于 2021 年正式弃用 Stitch 平台全面迁移至MongoDB Realm现统称为MongoDB Realm SDK。因此com.mongodb.stitch.android.core及整个stitch-android-sdk已停止维护不再接收更新或安全补丁官方推荐迁移到 MongoDB Realm Android SDK新包名io.realm:realm-android-sdk或io.realm:realm-android-library配合realm-sync使用新 SDK 提供更强大的离线同步、灵活的身份验证、细粒度权限控制及统一的跨平台 API。✅ 迁移建议替换依赖Gradle// ❌ 已废弃Stitch implementation com.mongodb.stitch:stitch-android-core: // ✅ 推荐Realm implementation io.realm:realm-android-library:10.19.3 // 请使用最新稳定版更新初始化方式从Stitch.initializeApp()→Realm.init()App.create()认证、数据库访问等 API 均重构需参考 Realm 官方文档。// 示例Stitch已过时初始化Stitch.initializeDefaultAppClient(your-stitch-app-id);// 示例Realm当前推荐初始化AppappnewApp(newAppConfiguration.Builder(your-realm-app-id).build());Package com.mongodb.stitch.android.coreWas this page helpful?YesNoSkip navigation linksOverview Package Class Tree Deprecated Index Help SEARCH:Package com.mongodb.stitch.android.coreThis package contains the entry point into the Android SDK with the Stitch and StitchAppClient classes.Interface Summary Interface Description StitchAppClient StitchAppClient is the main class used to work with Stitch. Class Summary Class Description Stitch The entry point into the Android SDK.Skip navigation linksOverview Package Class Tree Deprecated Index Help

更多文章